use of org.bimserver.interfaces.objects.SMetrics 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;
}
Aggregations