mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-29 13:36:04 +01:00
Add additional plugin, server and java version stats
This commit is contained in:
parent
2545b95d54
commit
052560393c
@ -436,6 +436,17 @@ public class ChestShop extends JavaPlugin {
|
|||||||
bStats.addCustomChart(new Metrics.SimplePie("distributionType", () -> dist));
|
bStats.addCustomChart(new Metrics.SimplePie("distributionType", () -> dist));
|
||||||
} catch (IOException ignored) {}
|
} catch (IOException ignored) {}
|
||||||
|
|
||||||
|
String serverVersion = getServer().getBukkitVersion().split("-")[0];
|
||||||
|
bStats.addCustomChart(createStaticDrilldownStat("versionMcSelf", serverVersion, getDescription().getVersion()));
|
||||||
|
bStats.addCustomChart(createStaticDrilldownStat("versionSelfMc", getDescription().getVersion(), serverVersion));
|
||||||
|
|
||||||
|
String javaVersion = System.getProperty("java.version");
|
||||||
|
bStats.addCustomChart(createStaticDrilldownStat("versionJavaSelf", javaVersion, getDescription().getVersion()));
|
||||||
|
bStats.addCustomChart(createStaticDrilldownStat("versionSelfJava", getDescription().getVersion(), javaVersion));
|
||||||
|
|
||||||
|
bStats.addCustomChart(createStaticDrilldownStat("versionJavaMc", javaVersion, serverVersion));
|
||||||
|
bStats.addCustomChart(createStaticDrilldownStat("versionMcJava", serverVersion, javaVersion));
|
||||||
|
|
||||||
bStats.addCustomChart(new Metrics.SingleLineChart("shopAccounts", NameManager::getAccountCount));
|
bStats.addCustomChart(new Metrics.SingleLineChart("shopAccounts", NameManager::getAccountCount));
|
||||||
bStats.addCustomChart(new Metrics.MultiLineChart("transactionCount", () -> ImmutableMap.of(
|
bStats.addCustomChart(new Metrics.MultiLineChart("transactionCount", () -> ImmutableMap.of(
|
||||||
"total", MetricsModule.getTotalTransactions(),
|
"total", MetricsModule.getTotalTransactions(),
|
||||||
@ -473,6 +484,11 @@ public class ChestShop extends JavaPlugin {
|
|||||||
() -> Properties.SHOP_CONTAINERS.stream().map(Material::name).collect(Collectors.toMap(k -> k, k -> 1))));
|
() -> Properties.SHOP_CONTAINERS.stream().map(Material::name).collect(Collectors.toMap(k -> k, k -> 1))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Metrics.DrilldownPie createStaticDrilldownStat(String statId, String value1, String value2) {
|
||||||
|
final Map<String, Map<String, Integer>> map = ImmutableMap.of(value1, ImmutableMap.of(value2, 1));
|
||||||
|
return new Metrics.DrilldownPie(statId, () -> map);
|
||||||
|
}
|
||||||
|
|
||||||
private int[] getChartArray(boolean value) {
|
private int[] getChartArray(boolean value) {
|
||||||
return new int[]{!value ? 1 : 0, value ? 0 : 1};
|
return new int[]{!value ? 1 : 0, value ? 0 : 1};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user