maybe
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m54s

This commit is contained in:
Lee
2024-04-18 15:47:05 +01:00
parent f037f3f9e7
commit 3ac4bfe2ee
19 changed files with 31 additions and 67 deletions

View File

@ -131,7 +131,7 @@ public class MetricService {
List<Point> points = new ArrayList<>();
for (Metric<?> metric : metrics.values()) {
if (metric.isCollector()) {
metric.collect(this);
metric.collect();
}
Point point = metric.toPoint();
if (point != null) {

View File

@ -35,7 +35,7 @@ public abstract class Metric<T> {
/**
* Collects the metric.
*/
public void collect(MetricService metricService) {}
public void collect() {}
/**
* Gets this point as a {@link Point}.

View File

@ -16,7 +16,7 @@ public class ConnectedSocketsMetric extends IntegerMetric {
}
@Override
public void collect(MetricService metricService) {
public void collect() {
setValue(MetricsWebSocketHandler.SESSIONS.size());
}
}

View File

@ -31,7 +31,7 @@ public class UniquePlayerLookupsMetric extends IntegerMetric {
}
@Override
public void collect(MetricService metricService) {
public void collect() {
setValue(uniqueLookups.size());
}
}

View File

@ -31,7 +31,7 @@ public class UniqueServerLookupsMetric extends IntegerMetric {
}
@Override
public void collect(MetricService metricService) {
public void collect() {
setValue(uniqueLookups.size());
}
}

View File

@ -22,7 +22,7 @@ public class CpuUsageMetric extends DoubleMetric {
}
@Override
public void collect(MetricService metricService) {
public void collect() {
this.setValue(OS_BEAN.getProcessCpuLoad() * 100);
}
}

View File

@ -15,7 +15,7 @@ public class MemoryMetric extends MapMetric<String, Long> {
}
@Override
public void collect(MetricService metricService) {
public void collect() {
Runtime runtime = Runtime.getRuntime();
this.getValue().put("total", runtime.maxMemory());