All Downloads are FREE. Search and download functionalities are using the official Maven repository.

eu.xenit.alfred.telemetry.webscripts.MetricsWebScript Maven / Gradle / Ivy

There is a newer version: 0.10.1
Show newest version
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