Check if spark enabled before registering metrics that require it
This commit is contained in:
parent
0e96325c79
commit
ec9349dce0
1 changed files with 5 additions and 2 deletions
|
@ -34,8 +34,11 @@ public class MetricRegistry {
|
||||||
this.registerMetric(new Entities());
|
this.registerMetric(new Entities());
|
||||||
this.registerMetric(new LoadedChunks());
|
this.registerMetric(new LoadedChunks());
|
||||||
this.registerMetric(new TotalLoadedChunks());
|
this.registerMetric(new TotalLoadedChunks());
|
||||||
this.registerMetric(new TicksPerSecond());
|
|
||||||
this.registerMetric(new MillisPerTick());
|
if (this.getExporter().getConfig().shouldUseSpark()) {
|
||||||
|
this.registerMetric(new TicksPerSecond());
|
||||||
|
this.registerMetric(new MillisPerTick());
|
||||||
|
}
|
||||||
|
|
||||||
this.registerCustomMetric("handshakes", new Counter.Builder()
|
this.registerCustomMetric("handshakes", new Counter.Builder()
|
||||||
.name(getMetricName("handshakes"))
|
.name(getMetricName("handshakes"))
|
||||||
|
|
Loading…
Reference in a new issue