Skip to content

Commit

Permalink
doc(DisplayMetricsMonitor): comments on use of micrometer interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
keturn committed Aug 8, 2021
1 parent 06ed38f commit 3824bbf
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
package org.terasology.engine.monitoring;

import io.micrometer.core.instrument.Clock;
import io.micrometer.core.instrument.logging.LoggingRegistryConfig;
import io.micrometer.core.instrument.step.StepMeterRegistry;
import io.micrometer.core.instrument.step.StepRegistryConfig;

import java.time.Duration;
import java.util.concurrent.TimeUnit;
Expand All @@ -15,7 +15,15 @@ public class DisplayMetricsMonitor extends StepMeterRegistry {
public static final Duration captureDuration = Duration.ofSeconds(1);

public DisplayMetricsMonitor() {
super(new LoggingRegistryConfig() {
// micrometer doesn't provide concrete implementations of these Config classes.
// We don't need to vary this configuration or load it from an external source,
// so we define it using an anonymous class here.
super(new StepRegistryConfig() {
@Override
public String prefix() {
return "display";
}

@Override
public String get(String key) {
return null;
Expand All @@ -30,7 +38,7 @@ public Duration step() {

@Override
protected void publish() {

// We don't need to push records anywhere. The view polls the current values; past steps are discarded.
}

@Override
Expand Down

0 comments on commit 3824bbf

Please sign in to comment.