Skip to content

Commit

Permalink
Add one-time server count to statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamesuta committed Mar 26, 2024
1 parent 82585b4 commit 206de47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.kamesuta</groupId>
<artifactId>BungeePteroPower</artifactId>
<version>1.7-SNAPSHOT</version>
<version>1.8-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BungeePteroPower</name>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/kamesuta/bungeepteropower/Statistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ public void register() {
// I would like to know the percentage of how many servers are using this plugin.
metrics.addCustomChart(new SimplePie("pteroServerCount", () -> String.valueOf(plugin.config.getServerNames().size())));
metrics.addCustomChart(new SimplePie("bungeeServerCount", () -> String.valueOf(proxyServer.getServers().size())));
metrics.addCustomChart(new SimplePie("restoreServerCount", () -> String.valueOf(plugin.config.getServerNames().stream()
.map(name -> plugin.config.getServerConfig(name))
.filter(server -> server != null && server.backupId != null && !server.backupId.isEmpty())
.count()
)));

// The number of power actions performed
for (ActionCounter.ActionType actionType : ActionCounter.ActionType.values()) {
Expand Down

0 comments on commit 206de47

Please sign in to comment.