test_class.declarator: logger = Logger.getLogger(AccumulationCacheTest.class.getCanonicalName())
test_class.modifier: private final static
test_class.original_string: private final static Logger logger = Logger.getLogger(AccumulationCacheTest.class.getCanonicalName());
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: CAPACITY = 2L
test_class.modifier: private final static
test_class.original_string: private final static long CAPACITY = 2L;
test_class.type: long
test_class.var_name: CAPACITY
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: 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: cache
test_class.modifier: private
test_class.original_string: private Cache<HistogramKey, AgentDigest> cache;
test_class.type: Cache<HistogramKey, AgentDigest>
test_class.var_name: cache
test_class.declarator: ac
test_class.modifier: private
test_class.original_string: private AccumulationCache ac;
test_class.type: AccumulationCache
test_class.var_name: ac
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: keyC = TestUtils.makeKey("keyC")
test_class.modifier: private
test_class.original_string: private HistogramKey keyC = TestUtils.makeKey("keyC");
test_class.type: HistogramKey
test_class.var_name: keyC
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.declarator: digestC
test_class.modifier: private
test_class.original_string: private AgentDigest digestC;
test_class.type: AgentDigest
test_class.var_name: digestC
test_class.declarator: tickerTime
test_class.modifier: private
test_class.original_string: private AtomicLong tickerTime;
test_class.type: AtomicLong
test_class.var_name: tickerTime
test_class.file: proxy/src/test/java/com/wavefront/agent/histogram/accumulator/AccumulationCacheTest.java
test_class.identifier: AccumulationCacheTest
test_case.body: @Test
    public void testAddCache() throws ExecutionException {
      cache.put(keyA, digestA);
      assertThat(cache.getIfPresent(keyA)).isEqualTo(digestA);
      assertThat(backingStore.get(keyA)).isNull();
    }
test_case.class_method_signature: AccumulationCacheTest.testAddCache()
test_case.full_signature: @Test public void testAddCache()
test_case.identifier: testAddCache
test_case.invocations: put isEqualTo assertThat getIfPresent isNull assertThat get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAddCache()
focal_class.declarator: logger = Logger.getLogger(AccumulationCache.class.getCanonicalName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(AccumulationCache.class.getCanonicalName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: sharedRegistry = SharedMetricsRegistry.getInstance()
focal_class.modifier: private static final
focal_class.original_string: private static final MetricsRegistry sharedRegistry = SharedMetricsRegistry.getInstance();
focal_class.type: MetricsRegistry
focal_class.var_name: sharedRegistry
focal_class.declarator: binCreatedCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter binCreatedCounter;
focal_class.type: Counter
focal_class.var_name: binCreatedCounter
focal_class.declarator: binMergedCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter binMergedCounter;
focal_class.type: Counter
focal_class.var_name: binMergedCounter
focal_class.declarator: cacheBinCreatedCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter cacheBinCreatedCounter;
focal_class.type: Counter
focal_class.var_name: cacheBinCreatedCounter
focal_class.declarator: cacheBinMergedCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter cacheBinMergedCounter;
focal_class.type: Counter
focal_class.var_name: cacheBinMergedCounter
focal_class.declarator: flushedCounter
focal_class.modifier: private final
focal_class.original_string: private final Counter flushedCounter;
focal_class.type: Counter
focal_class.var_name: flushedCounter
focal_class.declarator: cacheOverflowCounter = Metrics.newCounter(
        new MetricName("histogram.accumulator.cache", "", "size_exceeded"))
focal_class.modifier: private final
focal_class.original_string: private final Counter cacheOverflowCounter = Metrics.newCounter(
        new MetricName("histogram.accumulator.cache", "", "size_exceeded"));
focal_class.type: Counter
focal_class.var_name: cacheOverflowCounter
focal_class.declarator: cacheEnabled
focal_class.modifier: private final
focal_class.original_string: private final boolean cacheEnabled;
focal_class.type: boolean
focal_class.var_name: cacheEnabled
focal_class.declarator: cache
focal_class.modifier: private final
focal_class.original_string: private final Cache<HistogramKey, AgentDigest> cache;
focal_class.type: Cache<HistogramKey, AgentDigest>
focal_class.var_name: cache
focal_class.declarator: backingStore
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<HistogramKey, AgentDigest> backingStore;
focal_class.type: ConcurrentMap<HistogramKey, AgentDigest>
focal_class.var_name: backingStore
focal_class.declarator: agentDigestFactory
focal_class.modifier: private final
focal_class.original_string: private final AgentDigestFactory agentDigestFactory;
focal_class.type: AgentDigestFactory
focal_class.var_name: agentDigestFactory
focal_class.declarator: keyIndex
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<HistogramKey, Long> keyIndex;
focal_class.type: ConcurrentMap<HistogramKey, Long>
focal_class.var_name: keyIndex
focal_class.file: proxy/src/main/java/com/wavefront/agent/histogram/accumulator/AccumulationCache.java
focal_class.identifier: AccumulationCache
focal_class.interfaces: implements Accumulator
focal_class.class_method_signature: AccumulationCache.AccumulationCache(
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker)
focal_class.full_signature: public  AccumulationCache(
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker)
focal_class.identifier: AccumulationCache
focal_class.modifiers: public
focal_class.parameters: (
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker)
focal_class.signature:  AccumulationCache(
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker)
focal_class.class_method_signature: AccumulationCache.AccumulationCache(
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker,
        @Nullable Runnable onFailure)
focal_class.full_signature: @VisibleForTesting protected  AccumulationCache(
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker,
        @Nullable Runnable onFailure)
focal_class.identifier: AccumulationCache
focal_class.modifiers: @VisibleForTesting protected
focal_class.parameters: (
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker,
        @Nullable Runnable onFailure)
focal_class.signature:  AccumulationCache(
        final ConcurrentMap<HistogramKey, AgentDigest> backingStore,
        final AgentDigestFactory agentDigestFactory,
        final long cacheSize,
        String metricPrefix,
        @Nullable Ticker ticker,
        @Nullable Runnable onFailure)
focal_class.class_method_signature: AccumulationCache.getCache()
focal_class.full_signature: @VisibleForTesting Cache<HistogramKey, AgentDigest> getCache()
focal_class.identifier: getCache
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: ()
focal_class.return: Cache<HistogramKey, AgentDigest>
focal_class.signature: Cache<HistogramKey, AgentDigest> getCache()
focal_class.class_method_signature: AccumulationCache.put(HistogramKey key, @Nonnull AgentDigest value)
focal_class.full_signature: @Override public void put(HistogramKey key, @Nonnull AgentDigest value)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (HistogramKey key, @Nonnull AgentDigest value)
focal_class.return: void
focal_class.signature: void put(HistogramKey key, @Nonnull AgentDigest value)
focal_class.class_method_signature: AccumulationCache.put(HistogramKey key, double value)
focal_class.full_signature: @Override public void put(HistogramKey key, double value)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (HistogramKey key, double value)
focal_class.return: void
focal_class.signature: void put(HistogramKey key, double value)
focal_class.class_method_signature: AccumulationCache.put(HistogramKey key, Histogram value)
focal_class.full_signature: @Override public void put(HistogramKey key, Histogram value)
focal_class.identifier: put
focal_class.modifiers: @Override public
focal_class.parameters: (HistogramKey key, Histogram value)
focal_class.return: void
focal_class.signature: void put(HistogramKey key, Histogram value)
focal_class.class_method_signature: AccumulationCache.getRipeDigestsIterator(TimeProvider clock)
focal_class.full_signature: @Override public Iterator<HistogramKey> getRipeDigestsIterator(TimeProvider clock)
focal_class.identifier: getRipeDigestsIterator
focal_class.modifiers: @Override public
focal_class.parameters: (TimeProvider clock)
focal_class.return: Iterator<HistogramKey>
focal_class.signature: Iterator<HistogramKey> getRipeDigestsIterator(TimeProvider clock)
focal_class.class_method_signature: AccumulationCache.compute(HistogramKey key, BiFunction<? super HistogramKey,? super AgentDigest,
        ? extends AgentDigest> remappingFunction)
focal_class.full_signature: @Override public AgentDigest compute(HistogramKey key, BiFunction<? super HistogramKey,? super AgentDigest,
        ? extends AgentDigest> remappingFunction)
focal_class.identifier: compute
focal_class.modifiers: @Override public
focal_class.parameters: (HistogramKey key, BiFunction<? super HistogramKey,? super AgentDigest,
        ? extends AgentDigest> remappingFunction)
focal_class.return: AgentDigest
focal_class.signature: AgentDigest compute(HistogramKey key, BiFunction<? super HistogramKey,? super AgentDigest,
        ? extends AgentDigest> remappingFunction)
focal_class.class_method_signature: AccumulationCache.size()
focal_class.full_signature: @Override public long size()
focal_class.identifier: size
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long size()
focal_class.class_method_signature: AccumulationCache.flush()
focal_class.full_signature: @Override public void flush()
focal_class.identifier: flush
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void flush()
focal_method.body: @Override
    public void put(HistogramKey key, @Nonnull AgentDigest value) {
      cache.asMap().compute(key, (k, v) -> {
        if (v == null) {
          if (cacheEnabled) cacheBinCreatedCounter.inc();
          keyIndex.put(key, value.getDispatchTimeMillis());
          return value;
        } else {
          if (cacheEnabled) cacheBinMergedCounter.inc();
          keyIndex.compute(key, (k1, v1) -> (
              v1 != null && v1 < v.getDispatchTimeMillis() ? v1 : v.getDispatchTimeMillis()));
          v.add(value);
          return v;
        }
      });
    }
focal_method.class_method_signature: AccumulationCache.put(HistogramKey key, @Nonnull AgentDigest value)
focal_method.full_signature: @Override public void put(HistogramKey key, @Nonnull AgentDigest value)
focal_method.identifier: put
focal_method.invocations: compute asMap inc put getDispatchTimeMillis inc compute getDispatchTimeMillis getDispatchTimeMillis add
focal_method.modifiers: @Override public
focal_method.parameters: (HistogramKey key, @Nonnull AgentDigest value)
focal_method.return: void
focal_method.signature: void put(HistogramKey key, @Nonnull AgentDigest value)