use of org.xdi.model.metric.timer.TimerMetricData in project oxCore by GluuFederation.
the class LdapEntryReporter method builTimerEntries.
private List<MetricEntry> builTimerEntries(SortedMap<String, Timer> timers, Set<MetricType> registeredMetricTypes) {
List<MetricEntry> result = new ArrayList<MetricEntry>();
for (MetricType metricType : registeredMetricTypes) {
Timer timer = timers.get(metricType.getValue());
if (timer != null) {
Snapshot snapshot = timer.getSnapshot();
TimerMetricData timerMetricData = new TimerMetricData(timer.getCount(), convertRate(timer.getMeanRate()), convertRate(timer.getOneMinuteRate()), convertRate(timer.getFiveMinuteRate()), convertRate(timer.getFifteenMinuteRate()), getRateUnit(), convertDuration(snapshot.getMin()), convertDuration(snapshot.getMax()), convertDuration(snapshot.getMean()), convertDuration(snapshot.getStdDev()), convertDuration(snapshot.getMedian()), convertDuration(snapshot.get75thPercentile()), convertDuration(snapshot.get95thPercentile()), convertDuration(snapshot.get98thPercentile()), convertDuration(snapshot.get99thPercentile()), convertDuration(snapshot.get999thPercentile()), getDurationUnit());
TimerMetricEntry timerMetricEntry = new TimerMetricEntry();
timerMetricEntry.setMetricData(timerMetricData);
timerMetricEntry.setMetricType(metricType);
result.add(timerMetricEntry);
}
}
return result;
}
Aggregations