private void collectHistogramReports(List<DBObject> docs, SortedMap<String,Histogram> histograms, Date timestamp) {
if (histograms.isEmpty())
return;
for (Map.Entry<String, Histogram> entry : histograms.entrySet()) {
final BasicDBObject report = getBasicDBObject(timestamp, entry.getKey(), "histogram");
final Histogram histogram = entry.getValue();
final Snapshot s = histogram.getSnapshot();
report.put("count", s.size());
report.put("75th_percentile", s.get75thPercentile());
report.put("95th_percentile", s.get95thPercentile());
report.put("98th_percentile", s.get98thPercentile());
report.put("99th_percentile", s.get99thPercentile());
report.put("999th_percentile", s.get999thPercentile());
report.put("max", s.getMax());
report.put("min", s.getMin());
report.put("mean", s.getMean());
report.put("median", s.getMedian());
report.put("std_dev", s.getStdDev());
docs.add(report);
}
}