Skip to content

Add bStats metrics#9

Merged
AxenoDev merged 4 commits intomasterfrom
feat/bstats
Feb 8, 2026
Merged

Add bStats metrics#9
AxenoDev merged 4 commits intomasterfrom
feat/bstats

Conversation

@AxenoDev
Copy link
Owner

@AxenoDev AxenoDev commented Feb 8, 2026

Summary by CodeRabbit

  • Chores
    • Added analytics (bStats) to collect runtime usage metrics, including a chart reporting total homes.
    • Integrated MenuLib dependency to support enhanced menu functionality.

@AxenoDev AxenoDev added this to the 1.0.0 milestone Feb 8, 2026
@AxenoDev AxenoDev self-assigned this Feb 8, 2026
@AxenoDev AxenoDev added the ➕ Add Simple addition label Feb 8, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

Adds bStats metrics: new dependency and version property, shadowJar relocation, and runtime Metrics initialization in the plugin with a custom chart that sums total homes from HomeManager.

Changes

Cohort / File(s) Summary
Build Configuration
build.gradle, gradle.properties
Added org.bstats:bstats-bukkit dependency and shadowJar relocation for org.bstats; introduced menulib_version=1.3.6 and bstats_version=3.1.0 properties.
Plugin Initialization
src/main/java/me/axeno/hommr/Hommr.java
Initializes Metrics (bStats) during startup and registers a SingleLineChart named total_homes that computes the sum of home counts from HomeManager's cache.

Sequence Diagram(s)

sequenceDiagram
    participant Server as Hommr (plugin)
    participant HM as HomeManager
    participant bS as bStats Metrics

    Server->>HM: HomeManager.init()
    HM-->>Server: init complete
    Server->>bS: new Metrics(plugin, pluginId)
    Server->>bS: registerSingleLineChart("total_homes")
    bS->>HM: query getPlayerHomesCache()
    HM-->>bS: return player homes map
    bS-->>Server: submit chart value (sum of home counts)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰
I hopped in code at break of dawn,
Counting homes until the yawn,
bStats hums a tiny tune,
Charts aglow beneath the moon,
A rabbit's tally—metrics on! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add bStats metrics' directly and clearly summarizes the main change: integrating bStats metrics collection into the project.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/bstats

No actionable comments were generated in the recent review. 🎉


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@build.gradle`:
- Around line 45-46: The build file is missing the MenuLib dependency which
causes compilation failure at the MenuLib.init(this) call in Hommr.java; add an
implementation dependency entry to the dependencies block immediately after the
existing bstats line using the menulib properties (menulib_group,
menulib_artifact, menulib_version) defined in gradle.properties, and if the
correct groupId/artifactId for MenuLib are not present confirm and add them to
gradle.properties so the
implementation("${menulib_group}:${menulib_artifact}:${menulib_version}") line
resolves.

In `@gradle.properties`:
- Line 8: The property menulib_version in gradle.properties is unused; either
remove the menulib_version entry or add a dependency that consumes it. To fix,
if you intend to use MenuLib, add an implementation dependency in build.gradle
that references project property("menulib_version") (e.g., implementation
"com.example:menulib:${menulib_version}") so the property is consumed, or simply
delete the menulib_version line from gradle.properties to avoid an unused config
value.

In `@src/main/java/me/axeno/hommr/Hommr.java`:
- Line 57: The build fails because the MenuLib symbol used in Hommr.java
(MenuLib.init(this)) is unresolved; either add the MenuLib dependency to your
Gradle configuration (use the existing menulib_version from gradle.properties
and declare the corresponding dependency in build.gradle) and add the
appropriate import statement at the top of Hommr.java, or if MenuLib integration
is not ready simply remove the MenuLib.init(this) call from Hommr.java; locate
the reference to MenuLib.init(this) in the Hommr class to apply one of these
fixes and ensure imports and Gradle dependencies remain consistent with the
chosen approach.
🧹 Nitpick comments (1)
src/main/java/me/axeno/hommr/Hommr.java (1)

10-12: Unused imports.

DrilldownPie, SimplePie, HashMap, and Map are imported but never used. Remove them to keep the code clean.

🧹 Proposed fix
 import me.axeno.hommr.models.PlayerHomes;
 import org.bstats.bukkit.Metrics;
-import org.bstats.charts.DrilldownPie;
-import org.bstats.charts.SimplePie;
 import org.bstats.charts.SingleLineChart;
 import org.bukkit.Bukkit;
-import java.util.HashMap;
-import java.util.Map;
-

Also applies to: 21-22

@AxenoDev AxenoDev merged commit 55368e3 into master Feb 8, 2026
8 checks passed
@AxenoDev AxenoDev deleted the feat/bstats branch February 8, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

➕ Add Simple addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant