if (label.endsWith("/@/monitor")) {
// not include monitor information on this route itself
continue;
}
Timer timer = timerEntry.getValue();
if (i != 0) {
resp.getWriter().print(",");
}
double nsPerMs = 1000000;
resp.getWriter().print(String.format(Locale.ENGLISH,
"{ \"id\": %s, \"label\": \"%s\", \"hits\": %s, \"avg\": %.2f, \"lastVal\": %.2f, \"min\": %.2f, \"max\": %.2f," +
" \"active\": %.2f, \"avgActive\": %.2f }",
i++,
label,
timer.getCount(),
timer.getSnapshot().getMean() / nsPerMs,
timer.getSnapshot().getMedian() / nsPerMs,
timer.getSnapshot().getMin() / nsPerMs,
timer.getSnapshot().getMax() / nsPerMs,
timer.getOneMinuteRate(),
timer.getMeanRate()
));
}
resp.getWriter().print("]");
}
};