Skip to content

Commit

Permalink
Remove Metrics from Velocity module (Not supported yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed May 18, 2021
1 parent 4273259 commit 98d4808
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.server.ServerPing;
import org.bstats.charts.DrilldownPie;
import org.bstats.velocity.Metrics;
import org.slf4j.LoggerFactory;

import java.nio.file.Path;
Expand All @@ -48,17 +46,13 @@ public class VelocityCore implements PluginCore{
private final ProxyServer proxy;
private final Path path;

private final Metrics.Factory factory;

private OneVersionRemake core;

@Inject
public VelocityCore(ProxyServer proxy, @DataDirectory Path path, Metrics.Factory factory){
@Inject // TODO: Re-Add Metrics.Factory factory once Velocity 2 supports it
public VelocityCore(ProxyServer proxy, @DataDirectory Path path){
this.logger = new VelocityLogger(LoggerFactory.getLogger("OneVersionRemake"));
this.proxy = proxy;
this.path = path;

this.factory = factory;
}

@Subscribe
Expand Down Expand Up @@ -86,9 +80,11 @@ public void loadEventListeners(){

@Override
public void loadMetrics(){
Metrics metrics = factory.make(this, 10341);
// TODO: Re-Add Metrics once available for Velocity 2
//Metrics metrics = factory.make(this, 10341);

//metrics.addCustomChart(new DrilldownPie("allowed_protocols", () -> core.getPieMap()));

metrics.addCustomChart(new DrilldownPie("allowed_protocols", () -> core.getPieMap()));
}

@Override
Expand Down

0 comments on commit 98d4808

Please sign in to comment.