use of org.alfresco.solr.tracker.TrackerStats.Bucket in project SearchServices by Alfresco.
the class ContentSizeGroupingCollector method finish.
public void finish() throws IOException {
NamedList<Object> analytics = new NamedList<>();
rb.rsp.add("analytics", analytics);
NamedList<Object> fieldCounts = new NamedList<>();
analytics.add("contentSize()", fieldCounts);
for (Bucket bucket : stats.getHistogram()) {
fieldCounts.add("[" + (long) Math.ceil(bucket.leftBoundary) + " TO " + (long) Math.ceil(bucket.rightBoundary) + ">", (long) roundEven(bucket.countLeft + bucket.countRight));
}
if (this.delegate instanceof DelegatingCollector) {
((DelegatingCollector) this.delegate).finish();
}
}
Aggregations