eu.xenit.alfred.telemetry.webscripts.MetricsWebScript Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alfred-telemetry-platform Show documentation
Show all versions of alfred-telemetry-platform Show documentation
Alfred Telemetry Platform module which enables exposure of Metrics using Micrometer
package eu.xenit.alfred.telemetry.webscripts;
import eu.xenit.alfred.telemetry.service.MeterRegistryService;
import java.util.HashMap;
import java.util.Map;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.DeclarativeWebScript;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
public class MetricsWebScript extends DeclarativeWebScript {
private final MeterRegistryService meterRegistryService;
public MetricsWebScript(MeterRegistryService meterRegistryService) {
this.meterRegistryService = meterRegistryService;
}
@Override
protected Map executeImpl(WebScriptRequest req, Status status, Cache cache) {
final Map model = new HashMap<>();
model.put("names", meterRegistryService.getMeterNames());
return model;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy