Search in sources :

Example 1 with TimerMetricData

use of org.gluu.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;
}
Also used : Timer(com.codahale.metrics.Timer) MetricType(org.gluu.model.metric.MetricType) TimerMetricEntry(org.gluu.model.metric.timer.TimerMetricEntry) MetricEntry(org.gluu.model.metric.ldap.MetricEntry) CounterMetricEntry(org.gluu.model.metric.counter.CounterMetricEntry) TimerMetricData(org.gluu.model.metric.timer.TimerMetricData) TimerMetricEntry(org.gluu.model.metric.timer.TimerMetricEntry)

Aggregations

Timer (com.codahale.metrics.Timer)1 MetricType (org.gluu.model.metric.MetricType)1 CounterMetricEntry (org.gluu.model.metric.counter.CounterMetricEntry)1 MetricEntry (org.gluu.model.metric.ldap.MetricEntry)1 TimerMetricData (org.gluu.model.metric.timer.TimerMetricData)1 TimerMetricEntry (org.gluu.model.metric.timer.TimerMetricEntry)1