feat(telemetry): add metrics
This commit is contained in:
parent
a3227dfb94
commit
9fc902aa75
3 changed files with 12 additions and 2 deletions
|
@ -51,6 +51,7 @@ dependencies {
|
||||||
shadowImplementation("org.mariadb.jdbc:mariadb-java-client:3.3.1")
|
shadowImplementation("org.mariadb.jdbc:mariadb-java-client:3.3.1")
|
||||||
shadowImplementation("redis.clients:jedis:4.4.3")
|
shadowImplementation("redis.clients:jedis:4.4.3")
|
||||||
shadowImplementation("com.google.code.gson:gson:2.10.1")
|
shadowImplementation("com.google.code.gson:gson:2.10.1")
|
||||||
|
shadowImplementation("org.bstats:bstats-bukkit:3.0.2")
|
||||||
|
|
||||||
testImplementation("com.github.seeseemelk:MockBukkit-v1.20:3.58.0")
|
testImplementation("com.github.seeseemelk:MockBukkit-v1.20:3.58.0")
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
|
||||||
|
@ -89,6 +90,7 @@ tasks {
|
||||||
relocate("redis.clients", "xyz.ineanto.nicko.libs.redis")
|
relocate("redis.clients", "xyz.ineanto.nicko.libs.redis")
|
||||||
relocate("com.google.gson", "xyz.ineanto.nicko.libs.gson")
|
relocate("com.google.gson", "xyz.ineanto.nicko.libs.gson")
|
||||||
relocate("org.apache.commons.pool2", "xyz.ineanto.nicko.libs.pool2")
|
relocate("org.apache.commons.pool2", "xyz.ineanto.nicko.libs.pool2")
|
||||||
|
relocate("org.bstats", "xyz.ineanto.nicko.libs.bstats")
|
||||||
|
|
||||||
// EXCLUSIONS
|
// EXCLUSIONS
|
||||||
exclude("colors.bin")
|
exclude("colors.bin")
|
||||||
|
@ -97,7 +99,6 @@ tasks {
|
||||||
exclude("com/google/protobuf/**")
|
exclude("com/google/protobuf/**")
|
||||||
exclude("com/google/errorprone/**")
|
exclude("com/google/errorprone/**")
|
||||||
exclude("org/apache/commons/logging/**")
|
exclude("org/apache/commons/logging/**")
|
||||||
exclude("org/bstats/**")
|
|
||||||
exclude("org/jetbrains/**")
|
exclude("org/jetbrains/**")
|
||||||
exclude("org/intellij/**")
|
exclude("org/intellij/**")
|
||||||
exclude("org/checkerframework/**")
|
exclude("org/checkerframework/**")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package xyz.ineanto.nicko;
|
package xyz.ineanto.nicko;
|
||||||
|
|
||||||
import com.comphenix.protocol.utility.MinecraftVersion;
|
import com.comphenix.protocol.utility.MinecraftVersion;
|
||||||
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.command.PluginCommand;
|
import org.bukkit.command.PluginCommand;
|
||||||
|
@ -113,6 +114,7 @@ public class NickoBukkit extends JavaPlugin {
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);
|
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);
|
||||||
getServer().getPluginManager().registerEvents(new PlayerQuitListener(), this);
|
getServer().getPluginManager().registerEvents(new PlayerQuitListener(), this);
|
||||||
|
new Metrics(this, 20483);
|
||||||
}
|
}
|
||||||
|
|
||||||
getLogger().info("Nicko has been enabled.");
|
getLogger().info("Nicko has been enabled.");
|
||||||
|
|
|
@ -7,6 +7,8 @@ import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import xyz.ineanto.nicko.NickoBukkit;
|
import xyz.ineanto.nicko.NickoBukkit;
|
||||||
import xyz.ineanto.nicko.config.Configuration;
|
import xyz.ineanto.nicko.config.Configuration;
|
||||||
|
import xyz.ineanto.nicko.config.DefaultDataSources;
|
||||||
|
import xyz.ineanto.nicko.config.SQLDataSourceConfiguration;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
|
||||||
|
@ -16,7 +18,12 @@ public class ConfigurationTest {
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
MockBukkit.mock();
|
MockBukkit.mock();
|
||||||
plugin = MockBukkit.load(NickoBukkit.class);
|
final Configuration config = new Configuration(
|
||||||
|
DefaultDataSources.SQL_EMPTY,
|
||||||
|
DefaultDataSources.REDIS_EMPTY,
|
||||||
|
"",
|
||||||
|
false);
|
||||||
|
plugin = MockBukkit.load(NickoBukkit.class, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in a new issue