示例#1
0
 // from is non-inclusive
 public List<AggregateIntervalCollector> getOrderedIntervalCollectorsInRange(long from, long to) {
   List<AggregateIntervalCollector> intervalCollectors = Lists.newArrayList();
   for (AggregateIntervalCollector intervalCollector : getOrderedAllIntervalCollectors()) {
     long captureTime = intervalCollector.getCaptureTime();
     if (captureTime > from && captureTime <= to) {
       intervalCollectors.add(intervalCollector);
     }
   }
   return intervalCollectors;
 }
示例#2
0
 @Override
 public void run() {
   // this synchronized block is to ensure visibility of updates to this particular
   // activeIntervalCollector
   synchronized (intervalCollector) {
     try {
       intervalCollector.flush(collector);
     } catch (Throwable t) {
       // log and terminate successfully
       logger.error(t.getMessage(), t);
     } finally {
       pendingIntervalCollectors.remove(intervalCollector);
     }
   }
 }
示例#3
0
 public void clearAll() {
   activeIntervalCollector.clear();
   pendingIntervalCollectors.clear();
 }