Compare commits
1
Commits
main
..
3d9c5a5e21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d9c5a5e21 |
@@ -84,7 +84,6 @@ Some metrics depend on server implementations (TPS/MSPT, player ping, tile entit
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| spigot_chat_messages_total | counter | none | Total chat messages sent |
|
| spigot_chat_messages_total | counter | none | Total chat messages sent |
|
||||||
| spigot_player_movements_total | counter | none | Total player movement events |
|
| spigot_player_movements_total | counter | none | Total player movement events |
|
||||||
| spigot_player_movements_by_player_total | counter | player | Player movements by player |
|
|
||||||
| spigot_players_joined_total | counter | none | Total player joins |
|
| spigot_players_joined_total | counter | none | Total player joins |
|
||||||
| spigot_players_quit_total | counter | none | Total player quits |
|
| spigot_players_quit_total | counter | none | Total player quits |
|
||||||
| spigot_chunk_loads_total | counter | none | Total chunk load events |
|
| spigot_chunk_loads_total | counter | none | Total chunk load events |
|
||||||
@@ -93,12 +92,6 @@ Some metrics depend on server implementations (TPS/MSPT, player ping, tile entit
|
|||||||
| spigot_plugin_enable_total | counter | none | Total plugin enable events |
|
| spigot_plugin_enable_total | counter | none | Total plugin enable events |
|
||||||
| spigot_plugin_disable_total | counter | none | Total plugin disable events |
|
| spigot_plugin_disable_total | counter | none | Total plugin disable events |
|
||||||
| spigot_blocks_broken_total | counter | material | Blocks broken by material |
|
| spigot_blocks_broken_total | counter | material | Blocks broken by material |
|
||||||
| spigot_blocks_broken_by_player_total | counter | player,material | Blocks broken by player and material |
|
|
||||||
| spigot_blocks_placed_total | counter | material | Blocks placed by material |
|
|
||||||
| spigot_blocks_placed_by_player_total | counter | player,material | Blocks placed by player and material |
|
|
||||||
| spigot_items_crafted_total | counter | material | Items crafted by material |
|
|
||||||
| spigot_items_crafted_by_player_total | counter | player,material | Items crafted by player and material |
|
|
||||||
| spigot_entities_killed_total | counter | entity,killer | Entities killed by player |
|
|
||||||
| spigot_player_deaths_total | counter | cause | Player deaths by cause |
|
| spigot_player_deaths_total | counter | cause | Player deaths by cause |
|
||||||
| spigot_player_logins_failed_total | counter | reason | Failed player logins by reason |
|
| spigot_player_logins_failed_total | counter | reason | Failed player logins by reason |
|
||||||
| spigot_commands_blocked_total | counter | command | Blocked commands by name |
|
| spigot_commands_blocked_total | counter | command | Blocked commands by name |
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015 the original authors.
|
# Copyright © 2015-2021 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -114,6 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -171,6 +172,7 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -210,6 +212,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-1
@@ -70,10 +70,11 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,5 @@ public final class BlockBreakListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(BlockBreakEvent event) {
|
public void onBlockBreak(BlockBreakEvent event) {
|
||||||
registry.incrementBlocksBroken(event.getBlock().getType());
|
registry.incrementBlocksBroken(event.getBlock().getType());
|
||||||
registry.incrementBlocksBroken(event.getBlock().getType(), event.getPlayer().getName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,5 @@ public final class BlockPlaceListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
registry.incrementBlocksPlaced(event.getBlockPlaced().getType());
|
registry.incrementBlocksPlaced(event.getBlockPlaced().getType());
|
||||||
registry.incrementBlocksPlaced(event.getBlockPlaced().getType(), event.getPlayer().getName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.prometheus.spigot.listeners;
|
|||||||
|
|
||||||
import com.prometheus.spigot.metrics.MetricsRegistry;
|
import com.prometheus.spigot.metrics.MetricsRegistry;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
|
||||||
@@ -13,7 +12,7 @@ public final class ChatListener implements Listener {
|
|||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler
|
||||||
public void onChat(AsyncPlayerChatEvent event) {
|
public void onChat(AsyncPlayerChatEvent event) {
|
||||||
registry.incrementChatMessages();
|
registry.incrementChatMessages();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.prometheus.spigot.listeners;
|
|||||||
|
|
||||||
import com.prometheus.spigot.metrics.MetricsRegistry;
|
import com.prometheus.spigot.metrics.MetricsRegistry;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.CraftItemEvent;
|
import org.bukkit.event.inventory.CraftItemEvent;
|
||||||
@@ -22,8 +21,5 @@ public final class CraftListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
registry.incrementItemsCrafted(result.getType());
|
registry.incrementItemsCrafted(result.getType());
|
||||||
if (event.getWhoClicked() instanceof Player player) {
|
|
||||||
registry.incrementItemsCrafted(result.getType(), player.getName());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public final class MoveListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
registry.incrementPlayerMovements();
|
registry.incrementPlayerMovements();
|
||||||
registry.incrementPlayerMovements(event.getPlayer().getName());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasChangedBlock(PlayerMoveEvent event) {
|
private boolean hasChangedBlock(PlayerMoveEvent event) {
|
||||||
|
|||||||
@@ -46,16 +46,12 @@ public final class MetricsRegistry {
|
|||||||
private final LongAdder pluginDisables = new LongAdder();
|
private final LongAdder pluginDisables = new LongAdder();
|
||||||
private final ConcurrentHashMap<String, LongAdder> blocksPlacedByMaterial = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, LongAdder> blocksPlacedByMaterial = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<String, LongAdder> blocksBrokenByMaterial = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, LongAdder> blocksBrokenByMaterial = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<LabelPair, LongAdder> blocksBrokenByPlayerMaterial = new ConcurrentHashMap<>();
|
|
||||||
private final ConcurrentHashMap<LabelPair, LongAdder> blocksPlacedByPlayerMaterial = new ConcurrentHashMap<>();
|
|
||||||
private final ConcurrentHashMap<String, LongAdder> deathsByCause = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, LongAdder> deathsByCause = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<String, LongAdder> loginFailuresByReason = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, LongAdder> loginFailuresByReason = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<String, LongAdder> commandsBlocked = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, LongAdder> commandsBlocked = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<LabelPair, LongAdder> commandsExecuted = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<LabelPair, LongAdder> commandsExecuted = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<String, LongAdder> itemsCraftedByMaterial = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<String, LongAdder> itemsCraftedByMaterial = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<LabelPair, LongAdder> itemsCraftedByPlayerMaterial = new ConcurrentHashMap<>();
|
|
||||||
private final ConcurrentHashMap<LabelPair, LongAdder> entityKills = new ConcurrentHashMap<>();
|
private final ConcurrentHashMap<LabelPair, LongAdder> entityKills = new ConcurrentHashMap<>();
|
||||||
private final ConcurrentHashMap<String, LongAdder> playerMovementsByPlayer = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
public MetricsRegistry(Server server, boolean enableJvm, boolean enableProcess) {
|
public MetricsRegistry(Server server, boolean enableJvm, boolean enableProcess) {
|
||||||
this.server = server;
|
this.server = server;
|
||||||
@@ -76,10 +72,6 @@ public final class MetricsRegistry {
|
|||||||
playerMovements.increment();
|
playerMovements.increment();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementPlayerMovements(String player) {
|
|
||||||
incrementLabeledCounter(playerMovementsByPlayer, player);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void incrementPlayerJoins() {
|
public void incrementPlayerJoins() {
|
||||||
playerJoins.increment();
|
playerJoins.increment();
|
||||||
}
|
}
|
||||||
@@ -96,26 +88,10 @@ public final class MetricsRegistry {
|
|||||||
incrementLabeledCounter(blocksBrokenByMaterial, material.name());
|
incrementLabeledCounter(blocksBrokenByMaterial, material.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementBlocksBroken(Material material, String player) {
|
|
||||||
String normalizedMaterial = normalizeLabel(material.name());
|
|
||||||
String normalizedPlayer = normalizeLabel(player);
|
|
||||||
blocksBrokenByPlayerMaterial
|
|
||||||
.computeIfAbsent(new LabelPair(normalizedPlayer, normalizedMaterial), key -> new LongAdder())
|
|
||||||
.increment();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void incrementBlocksPlaced(Material material) {
|
public void incrementBlocksPlaced(Material material) {
|
||||||
incrementLabeledCounter(blocksPlacedByMaterial, material.name());
|
incrementLabeledCounter(blocksPlacedByMaterial, material.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementBlocksPlaced(Material material, String player) {
|
|
||||||
String normalizedMaterial = normalizeLabel(material.name());
|
|
||||||
String normalizedPlayer = normalizeLabel(player);
|
|
||||||
blocksPlacedByPlayerMaterial
|
|
||||||
.computeIfAbsent(new LabelPair(normalizedPlayer, normalizedMaterial), key -> new LongAdder())
|
|
||||||
.increment();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void incrementPlayerDeath(EntityDamageEvent.DamageCause cause) {
|
public void incrementPlayerDeath(EntityDamageEvent.DamageCause cause) {
|
||||||
incrementLabeledCounter(deathsByCause, cause.name());
|
incrementLabeledCounter(deathsByCause, cause.name());
|
||||||
}
|
}
|
||||||
@@ -158,14 +134,6 @@ public final class MetricsRegistry {
|
|||||||
incrementLabeledCounter(itemsCraftedByMaterial, material.name());
|
incrementLabeledCounter(itemsCraftedByMaterial, material.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementItemsCrafted(Material material, String player) {
|
|
||||||
String normalizedMaterial = normalizeLabel(material.name());
|
|
||||||
String normalizedPlayer = normalizeLabel(player);
|
|
||||||
itemsCraftedByPlayerMaterial
|
|
||||||
.computeIfAbsent(new LabelPair(normalizedPlayer, normalizedMaterial), key -> new LongAdder())
|
|
||||||
.increment();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void incrementEntityKill(EntityType entityType, String killer) {
|
public void incrementEntityKill(EntityType entityType, String killer) {
|
||||||
String normalizedEntity = normalizeLabel(entityType.name());
|
String normalizedEntity = normalizeLabel(entityType.name());
|
||||||
String normalizedKiller = normalizeLabel(killer);
|
String normalizedKiller = normalizeLabel(killer);
|
||||||
@@ -217,21 +185,13 @@ public final class MetricsRegistry {
|
|||||||
appendCounter(builder, "spigot_plugin_disable_total", "Total plugin disable events", pluginDisables.sum());
|
appendCounter(builder, "spigot_plugin_disable_total", "Total plugin disable events", pluginDisables.sum());
|
||||||
|
|
||||||
appendLabeledCounterAdder(builder, "spigot_blocks_broken_total", "Blocks broken by material", "material", blocksBrokenByMaterial);
|
appendLabeledCounterAdder(builder, "spigot_blocks_broken_total", "Blocks broken by material", "material", blocksBrokenByMaterial);
|
||||||
appendLabeledCounterAdder(builder, "spigot_blocks_broken_by_player_total", "Blocks broken by player and material", "player",
|
|
||||||
"material", blocksBrokenByPlayerMaterial);
|
|
||||||
appendLabeledCounterAdder(builder, "spigot_blocks_placed_total", "Blocks placed by material", "material", blocksPlacedByMaterial);
|
appendLabeledCounterAdder(builder, "spigot_blocks_placed_total", "Blocks placed by material", "material", blocksPlacedByMaterial);
|
||||||
appendLabeledCounterAdder(builder, "spigot_blocks_placed_by_player_total", "Blocks placed by player and material", "player",
|
|
||||||
"material", blocksPlacedByPlayerMaterial);
|
|
||||||
appendLabeledCounterAdder(builder, "spigot_player_deaths_total", "Player deaths by cause", "cause", deathsByCause);
|
appendLabeledCounterAdder(builder, "spigot_player_deaths_total", "Player deaths by cause", "cause", deathsByCause);
|
||||||
appendLabeledCounterAdder(builder, "spigot_player_logins_failed_total", "Failed player logins by reason", "reason", loginFailuresByReason);
|
appendLabeledCounterAdder(builder, "spigot_player_logins_failed_total", "Failed player logins by reason", "reason", loginFailuresByReason);
|
||||||
appendLabeledCounterAdder(builder, "spigot_commands_blocked_total", "Blocked commands by name", "command", commandsBlocked);
|
appendLabeledCounterAdder(builder, "spigot_commands_blocked_total", "Blocked commands by name", "command", commandsBlocked);
|
||||||
appendLabeledCounterAdder(builder, "spigot_commands_executed_total", "Commands executed by source", "command", "source", commandsExecuted);
|
appendLabeledCounterAdder(builder, "spigot_commands_executed_total", "Commands executed by source", "command", "source", commandsExecuted);
|
||||||
appendLabeledCounterAdder(builder, "spigot_items_crafted_total", "Items crafted by material", "material", itemsCraftedByMaterial);
|
appendLabeledCounterAdder(builder, "spigot_items_crafted_total", "Items crafted by material", "material", itemsCraftedByMaterial);
|
||||||
appendLabeledCounterAdder(builder, "spigot_items_crafted_by_player_total", "Items crafted by player and material", "player",
|
|
||||||
"material", itemsCraftedByPlayerMaterial);
|
|
||||||
appendLabeledCounterAdder(builder, "spigot_entities_killed_total", "Entities killed by player", "entity", "killer", entityKills);
|
appendLabeledCounterAdder(builder, "spigot_entities_killed_total", "Entities killed by player", "entity", "killer", entityKills);
|
||||||
appendLabeledCounterAdder(builder, "spigot_player_movements_by_player_total", "Player movements by player", "player",
|
|
||||||
playerMovementsByPlayer);
|
|
||||||
|
|
||||||
appendGauge(builder, "spigot_players_online", "Online player count", server.getOnlinePlayers().size());
|
appendGauge(builder, "spigot_players_online", "Online player count", server.getOnlinePlayers().size());
|
||||||
appendGauge(builder, "spigot_players_max", "Max player slots", server.getMaxPlayers());
|
appendGauge(builder, "spigot_players_max", "Max player slots", server.getMaxPlayers());
|
||||||
|
|||||||
Reference in New Issue
Block a user