|
@@ -180,6 +180,10 @@ public class DataReportor extends ScheduledReporter {
|
|
|
|
|
|
private final Clock clock;
|
|
|
|
|
|
+ private List<ReportInfo> reportInfoList = Lists.newArrayList();
|
|
|
+
|
|
|
+ private int maxReportInfoSize = 10;
|
|
|
+
|
|
|
private DataReportor(MetricRegistry registry, Clock clock, TimeUnit rateUnit,
|
|
|
TimeUnit durationUnit, MetricFilter filter, ScheduledExecutorService executor,
|
|
|
boolean shutdownExecutorOnStop, Set<MetricAttribute> disabledMetricAttributes) {
|
|
@@ -215,6 +219,11 @@ public class DataReportor extends ScheduledReporter {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (reportInfoList.size() >= maxReportInfoSize) {
|
|
|
+ reportInfoList = reportInfoList.subList(0, maxReportInfoSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ reportInfoList.add(0, info);
|
|
|
}
|
|
|
|
|
|
private MeterInfo getMeterInfo(String key, Meter meter) {
|
|
@@ -302,4 +311,9 @@ public class DataReportor extends ScheduledReporter {
|
|
|
private boolean isEnabled(MetricAttribute type) {
|
|
|
return !getDisabledMetricAttributes().contains(type);
|
|
|
}
|
|
|
+
|
|
|
+ public List<ReportInfo> getReportInfoList() {
|
|
|
+ return reportInfoList;
|
|
|
+ }
|
|
|
+
|
|
|
}
|