Search in sources :

Example 1 with Counter

use of org.apache.jena.fuseki.server.Counter in project jena by apache.

the class FusekiRequestsMetrics method bindTo.

@Override
public void bindTo(MeterRegistry registry) {
    DataService dataService = dataAccessPoint.getDataService();
    for (Operation operation : dataService.getOperations()) {
        List<Endpoint> endpoints = dataService.getEndpoints(operation);
        for (Endpoint endpoint : endpoints) {
            CounterSet counters = endpoint.getCounters();
            for (CounterName counterName : counters.counters()) {
                Counter counter = counters.get(counterName);
                Gauge.builder("fuseki_" + counterName.getFullName(), counter, Counter::value).tags(new String[] { "dataset", dataAccessPoint.getName(), "endpoint", endpoint.getName(), "operation", operation.getName(), "description", operation.getDescription() }).register(registry);
            }
        }
    }
}
Also used : Counter(org.apache.jena.fuseki.server.Counter) Endpoint(org.apache.jena.fuseki.server.Endpoint) CounterSet(org.apache.jena.fuseki.server.CounterSet) CounterName(org.apache.jena.fuseki.server.CounterName) Operation(org.apache.jena.fuseki.server.Operation) DataService(org.apache.jena.fuseki.server.DataService)

Aggregations

Counter (org.apache.jena.fuseki.server.Counter)1 CounterName (org.apache.jena.fuseki.server.CounterName)1 CounterSet (org.apache.jena.fuseki.server.CounterSet)1 DataService (org.apache.jena.fuseki.server.DataService)1 Endpoint (org.apache.jena.fuseki.server.Endpoint)1 Operation (org.apache.jena.fuseki.server.Operation)1