mirror of
https://github.com/ColdeZhang/Dominion.git
synced 2024-12-25 03:48:57 +08:00
新增数据统计项
This commit is contained in:
parent
c858332fbd
commit
fb1736e0f2
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>Dominion</artifactId>
|
||||
<version>1.35.8-beta</version>
|
||||
<version>1.35.9-beta</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Dominion</name>
|
||||
|
@ -433,6 +433,22 @@ public class Cache {
|
||||
return new ArrayList<>(id_dominions.values());
|
||||
}
|
||||
|
||||
public int getDominionCounts() {
|
||||
return id_dominions.size();
|
||||
}
|
||||
|
||||
public int getMemberCounts() {
|
||||
int count = 0;
|
||||
for (Map<Integer, MemberDTO> member : player_uuid_to_member.values()) {
|
||||
count += member.size();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public int getGroupCounts() {
|
||||
return id_groups.size();
|
||||
}
|
||||
|
||||
public static Cache instance;
|
||||
private ConcurrentHashMap<Integer, DominionDTO> id_dominions;
|
||||
private ConcurrentHashMap<String, List<DominionNode>> world_dominion_tree;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.lunadeer.dominion;
|
||||
|
||||
import cn.lunadeer.dominion.dtos.PrivilegeTemplateDTO;
|
||||
import cn.lunadeer.dominion.events.EnvironmentEvents;
|
||||
import cn.lunadeer.dominion.events.PlayerEvents;
|
||||
import cn.lunadeer.dominion.events.SelectPointEvents;
|
||||
@ -46,6 +47,9 @@ public final class Dominion extends JavaPlugin {
|
||||
|
||||
bStatsMetrics metrics = new bStatsMetrics(this, 21445);
|
||||
metrics.addCustomChart(new bStatsMetrics.SimplePie("database", () -> config.getDbType()));
|
||||
metrics.addCustomChart(new bStatsMetrics.SingleLineChart("dominion_count", () -> Cache.instance.getDominionCounts()));
|
||||
metrics.addCustomChart(new bStatsMetrics.SingleLineChart("group_count", () -> Cache.instance.getGroupCounts()));
|
||||
metrics.addCustomChart(new bStatsMetrics.SingleLineChart("member_count", () -> Cache.instance.getMemberCounts()));
|
||||
|
||||
if (config.getCheckUpdate()) {
|
||||
giteaReleaseCheck = new GiteaReleaseCheck(this,
|
||||
|
Loading…
Reference in New Issue
Block a user