Search in sources :

Example 1 with SMethodMetric

use of org.bimserver.interfaces.objects.SMethodMetric in project BIMserver by opensourceBIM.

the class MetricsRegistry method getMetrics.

public synchronized SMetrics getMetrics() {
    SMetrics sMetrics = new SMetrics();
    for (SService sService : methodStats.keySet()) {
        SInterfaceMetric interfaceMetric = new SInterfaceMetric();
        interfaceMetric.setName(sService.getSimpleName());
        sMetrics.getInterfaces().add(interfaceMetric);
        for (SMethod sMethod : methodStats.get(sService).keySet()) {
            SMethodMetric sMethodMetric = new SMethodMetric();
            sMethodMetric.setName(sMethod.getName());
            interfaceMetric.getMethods().add(sMethodMetric);
            MethodStats methodStats = getMethodStats(sMethod);
            sMethodMetric.setNrCalls(methodStats.getNrCalls());
            sMethodMetric.setAverageMs(methodStats.getAverageNanoSecondsPerCall() / 1000000);
        }
    }
    return sMetrics;
}
Also used : SMethodMetric(org.bimserver.interfaces.objects.SMethodMetric) SMetrics(org.bimserver.interfaces.objects.SMetrics) SMethod(org.bimserver.shared.meta.SMethod) SInterfaceMetric(org.bimserver.interfaces.objects.SInterfaceMetric) SService(org.bimserver.shared.meta.SService)

Aggregations

SInterfaceMetric (org.bimserver.interfaces.objects.SInterfaceMetric)1 SMethodMetric (org.bimserver.interfaces.objects.SMethodMetric)1 SMetrics (org.bimserver.interfaces.objects.SMetrics)1 SMethod (org.bimserver.shared.meta.SMethod)1 SService (org.bimserver.shared.meta.SService)1