test_class.declarator: COMPRESSION = 100
test_class.modifier: private final static
test_class.original_string: private final static short COMPRESSION = 100;
test_class.type: short
test_class.var_name: COMPRESSION
test_class.declarator: in
test_class.modifier: private
test_class.original_string: private AccumulationCache in;
test_class.type: AccumulationCache
test_class.var_name: in
test_class.declarator: backingStore
test_class.modifier: private
test_class.original_string: private ConcurrentMap<HistogramKey, AgentDigest> backingStore;
test_class.type: ConcurrentMap<HistogramKey, AgentDigest>
test_class.var_name: backingStore
test_class.declarator: pointOut
test_class.modifier: private
test_class.original_string: private List<ReportPoint> pointOut;
test_class.type: List<ReportPoint>
test_class.var_name: pointOut
test_class.declarator: debugLineOut
test_class.modifier: private
test_class.original_string: private List<String> debugLineOut;
test_class.type: List<String>
test_class.var_name: debugLineOut
test_class.declarator: blockedOut
test_class.modifier: private
test_class.original_string: private List<ReportPoint> blockedOut;
test_class.type: List<ReportPoint>
test_class.var_name: blockedOut
test_class.declarator: timeMillis
test_class.modifier: private
test_class.original_string: private AtomicLong timeMillis;
test_class.type: AtomicLong
test_class.var_name: timeMillis
test_class.declarator: subject
test_class.modifier: private
test_class.original_string: private PointHandlerDispatcher subject;
test_class.type: PointHandlerDispatcher
test_class.var_name: subject
test_class.declarator: keyA = TestUtils.makeKey("keyA")
test_class.modifier: private
test_class.original_string: private HistogramKey keyA = TestUtils.makeKey("keyA");
test_class.type: HistogramKey
test_class.var_name: keyA
test_class.declarator: keyB = TestUtils.makeKey("keyB")
test_class.modifier: private
test_class.original_string: private HistogramKey keyB = TestUtils.makeKey("keyB");
test_class.type: HistogramKey
test_class.var_name: keyB
test_class.declarator: digestA
test_class.modifier: private
test_class.original_string: private AgentDigest digestA;
test_class.type: AgentDigest
test_class.var_name: digestA
test_class.declarator: digestB
test_class.modifier: private
test_class.original_string: private AgentDigest digestB;
test_class.type: AgentDigest
test_class.var_name: digestB
test_class.file: proxy/src/test/java/com/wavefront/agent/histogram/PointHandlerDispatcherTest.java
test_class.identifier: PointHandlerDispatcherTest
test_case.body: @Test
    public void testBasicDispatch() {
      in.put(keyA, digestA);
      in.flush();
  
      timeMillis.set(101L);
      subject.run();
  
      assertThat(pointOut).hasSize(1);
      assertThat(blockedOut).hasSize(0);
      assertThat(backingStore).isEmpty();
  
      ReportPoint point = pointOut.get(0);
  
      TestUtils.testKeyPointMatch(keyA, point);
    }
test_case.class_method_signature: PointHandlerDispatcherTest.testBasicDispatch()
test_case.full_signature: @Test public void testBasicDispatch()
test_case.identifier: testBasicDispatch
test_case.invocations: put flush set run hasSize assertThat hasSize assertThat isEmpty assertThat get testKeyPointMatch
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBasicDispatch()
focal_class.declarator: logger = Logger.getLogger(
        PointHandlerDispatcher.class.getCanonicalName())
focal_class.modifier: private final static
focal_class.original_string: private final static Logger logger = Logger.getLogger(
        PointHandlerDispatcher.class.getCanonicalName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: featureDisabledLogger = new MessageDedupingLogger(logger, 2, 0.2)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger featureDisabledLogger = new MessageDedupingLogger(logger, 2, 0.2);
focal_class.type: Logger
focal_class.var_name: featureDisabledLogger
focal_class.declarator: dispatchCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter dispatchCounter;
focal_class.type: Counter
focal_class.var_name: dispatchCounter
focal_class.declarator: dispatchErrorCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter dispatchErrorCounter;
focal_class.type: Counter
focal_class.var_name: dispatchErrorCounter
focal_class.declarator: dispatchProcessTime
focal_class.modifier: private final
focal_class.original_string: private final Counter dispatchProcessTime;
focal_class.type: Counter
focal_class.var_name: dispatchProcessTime
focal_class.declarator: digests
focal_class.modifier: private final
focal_class.original_string: private final Accumulator digests;
focal_class.type: Accumulator
focal_class.var_name: digests
focal_class.declarator: digestsSize = new AtomicLong(0)
focal_class.modifier: private final
focal_class.original_string: private final AtomicLong digestsSize = new AtomicLong(0);
focal_class.type: AtomicLong
focal_class.var_name: digestsSize
focal_class.declarator: output
focal_class.modifier: private final
focal_class.original_string: private final ReportableEntityHandler<ReportPoint, String> output;
focal_class.type: ReportableEntityHandler<ReportPoint, String>
focal_class.var_name: output
focal_class.declarator: clock
focal_class.modifier: private final
focal_class.original_string: private final TimeProvider clock;
focal_class.type: TimeProvider
focal_class.var_name: clock
focal_class.declarator: histogramDisabled
focal_class.modifier: private final
focal_class.original_string: private final Supplier<Boolean> histogramDisabled;
focal_class.type: Supplier<Boolean>
focal_class.var_name: histogramDisabled
focal_class.declarator: dispatchLimit
focal_class.modifier: private final
focal_class.original_string: private final Integer dispatchLimit;
focal_class.type: Integer
focal_class.var_name: dispatchLimit
focal_class.file: proxy/src/main/java/com/wavefront/agent/histogram/PointHandlerDispatcher.java
focal_class.identifier: PointHandlerDispatcher
focal_class.interfaces: implements Runnable
focal_class.class_method_signature: PointHandlerDispatcher.PointHandlerDispatcher(Accumulator digests,
                                  ReportableEntityHandler<ReportPoint, String> output,
                                  TimeProvider clock,
                                  Supplier<Boolean> histogramDisabled,
                                  @Nullable Integer dispatchLimit,
                                  @Nullable Granularity granularity)
focal_class.full_signature: public  PointHandlerDispatcher(Accumulator digests,
                                  ReportableEntityHandler<ReportPoint, String> output,
                                  TimeProvider clock,
                                  Supplier<Boolean> histogramDisabled,
                                  @Nullable Integer dispatchLimit,
                                  @Nullable Granularity granularity)
focal_class.identifier: PointHandlerDispatcher
focal_class.modifiers: public
focal_class.parameters: (Accumulator digests,
                                  ReportableEntityHandler<ReportPoint, String> output,
                                  TimeProvider clock,
                                  Supplier<Boolean> histogramDisabled,
                                  @Nullable Integer dispatchLimit,
                                  @Nullable Granularity granularity)
focal_class.signature:  PointHandlerDispatcher(Accumulator digests,
                                  ReportableEntityHandler<ReportPoint, String> output,
                                  TimeProvider clock,
                                  Supplier<Boolean> histogramDisabled,
                                  @Nullable Integer dispatchLimit,
                                  @Nullable Granularity granularity)
focal_class.class_method_signature: PointHandlerDispatcher.run()
focal_class.full_signature: @Override public void run()
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_method.body: @Override
    public void run() {
      try {
        AtomicInteger dispatchedCount = new AtomicInteger(0);
  
        long startMillis = System.currentTimeMillis();
        digestsSize.set(digests.size()); // update size before flushing, so we show a higher value
        Iterator<HistogramKey> index = digests.getRipeDigestsIterator(this.clock);
        while (index.hasNext()) {
          digests.compute(index.next(), (k, v) -> {
            if (v == null) {
              index.remove();
              return null;
            }
            if (histogramDisabled.get()) {
              featureDisabledLogger.info("Histogram feature is not enabled on the server!");
              dispatchErrorCounter.inc();
            } else {
              try {
                ReportPoint out = HistogramUtils.pointFromKeyAndDigest(k, v);
                output.report(out);
                dispatchCounter.inc();
              } catch (Exception e) {
                dispatchErrorCounter.inc();
                logger.log(Level.SEVERE, "Failed dispatching entry " + k, e);
              }
            }
            index.remove();
            dispatchedCount.incrementAndGet();
            return null;
          });
          if (dispatchLimit != null && dispatchedCount.get() >= dispatchLimit)
            break;
        }
        dispatchProcessTime.inc(System.currentTimeMillis() - startMillis);
      } catch (Exception e) {
        logger.log(Level.SEVERE, "PointHandlerDispatcher error", e);
      }
    }
focal_method.class_method_signature: PointHandlerDispatcher.run()
focal_method.full_signature: @Override public void run()
focal_method.identifier: run
focal_method.invocations: currentTimeMillis set size getRipeDigestsIterator hasNext compute next remove get info inc pointFromKeyAndDigest report inc inc log remove incrementAndGet get inc currentTimeMillis log
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void run()