test_class.file: misc/metrics-extensions/modules/ballerina-metrics-extension/src/test/java/org/ballerinalang/observe/metrics/extension/defaultimpl/RollingHistogramTest.java
test_class.identifier: RollingHistogramTest
test_case.body: @Test
      public void percentilesWithNoSamples() {
          double[] percentiles = new double[]{0.5, 0.9, 0.95};
          RollingHistogram histogram = new RollingHistogram(Clock.DEFAULT, StatisticConfig.builder()
                  .percentiles(percentiles)
                  .expiry(Duration.ofDays(1)).buckets(3).build());
          Snapshot snapshot = histogram.getSnapshot();
          PercentileValue[] percentileValues = snapshot.getPercentileValues();
          for (int i = 0; i < percentiles.length; i++) {
              Assert.assertEquals(percentileValues[i].getPercentile(), percentiles[i]);
              Assert.assertEquals(percentileValues[i].getValue(), 0.0);
          }
      }
test_case.class_method_signature: RollingHistogramTest.percentilesWithNoSamples()
test_case.full_signature: @Test public void percentilesWithNoSamples()
test_case.identifier: percentilesWithNoSamples
test_case.invocations: build buckets expiry percentiles builder ofDays getSnapshot getPercentileValues assertEquals getPercentile assertEquals getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void percentilesWithNoSamples()
focal_class.declarator: clock
focal_class.modifier: private final
focal_class.original_string: private final Clock clock;
focal_class.type: Clock
focal_class.var_name: clock
focal_class.declarator: statisticConfig
focal_class.modifier: private final
focal_class.original_string: private final StatisticConfig statisticConfig;
focal_class.type: StatisticConfig
focal_class.var_name: statisticConfig
focal_class.declarator: ringBuffer
focal_class.modifier: private final
focal_class.original_string: private final DoubleRecorder[] ringBuffer;
focal_class.type: DoubleRecorder[]
focal_class.var_name: ringBuffer
focal_class.declarator: currentBucket
focal_class.modifier: private
focal_class.original_string: private int currentBucket;
focal_class.type: int
focal_class.var_name: currentBucket
focal_class.declarator: lastRotateTimestampMillis
focal_class.modifier: private volatile
focal_class.original_string: private volatile long lastRotateTimestampMillis;
focal_class.type: long
focal_class.var_name: lastRotateTimestampMillis
focal_class.declarator: durationBetweenRotatesMillis
focal_class.modifier: private final
focal_class.original_string: private final long durationBetweenRotatesMillis;
focal_class.type: long
focal_class.var_name: durationBetweenRotatesMillis
focal_class.declarator: intervalHistogram
focal_class.modifier: private final
focal_class.original_string: private final DoubleHistogram intervalHistogram;
focal_class.type: DoubleHistogram
focal_class.var_name: intervalHistogram
focal_class.declarator: accumulatedHistogram
focal_class.modifier: private
focal_class.original_string: private DoubleHistogram accumulatedHistogram;
focal_class.type: DoubleHistogram
focal_class.var_name: accumulatedHistogram
focal_class.declarator: rotatingUpdater =
              AtomicIntegerFieldUpdater.newUpdater(RollingHistogram.class, "rotating")
focal_class.modifier: private static final
focal_class.original_string: private static final AtomicIntegerFieldUpdater<RollingHistogram> rotatingUpdater =
              AtomicIntegerFieldUpdater.newUpdater(RollingHistogram.class, "rotating");
focal_class.type: AtomicIntegerFieldUpdater<RollingHistogram>
focal_class.var_name: rotatingUpdater
focal_class.declarator: rotating
focal_class.modifier: private volatile
focal_class.original_string: private volatile int rotating;
focal_class.type: int
focal_class.var_name: rotating
focal_class.declarator: accumulatedHistogramStale
focal_class.modifier: private volatile
focal_class.original_string: private volatile boolean accumulatedHistogramStale;
focal_class.type: boolean
focal_class.var_name: accumulatedHistogramStale
focal_class.file: misc/metrics-extensions/modules/ballerina-metrics-extension/src/main/java/org/ballerinalang/observe/metrics/extension/defaultimpl/RollingHistogram.java
focal_class.identifier: RollingHistogram
focal_class.class_method_signature: RollingHistogram.RollingHistogram(Clock clock, StatisticConfig statisticConfig)
focal_class.full_signature: public  RollingHistogram(Clock clock, StatisticConfig statisticConfig)
focal_class.identifier: RollingHistogram
focal_class.modifiers: public
focal_class.parameters: (Clock clock, StatisticConfig statisticConfig)
focal_class.signature:  RollingHistogram(Clock clock, StatisticConfig statisticConfig)
focal_class.class_method_signature: RollingHistogram.record(double value)
focal_class.full_signature: public void record(double value)
focal_class.identifier: record
focal_class.modifiers: public
focal_class.parameters: (double value)
focal_class.return: void
focal_class.signature: void record(double value)
focal_class.class_method_signature: RollingHistogram.rotate()
focal_class.full_signature: private void rotate()
focal_class.identifier: rotate
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void rotate()
focal_class.class_method_signature: RollingHistogram.getStatisticConfig()
focal_class.full_signature: public StatisticConfig getStatisticConfig()
focal_class.identifier: getStatisticConfig
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: StatisticConfig
focal_class.signature: StatisticConfig getStatisticConfig()
focal_class.class_method_signature: RollingHistogram.getSnapshot()
focal_class.full_signature: public Snapshot getSnapshot()
focal_class.identifier: getSnapshot
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Snapshot
focal_class.signature: Snapshot getSnapshot()
focal_class.class_method_signature: RollingHistogram.accumulateIfStale()
focal_class.full_signature: private void accumulateIfStale()
focal_class.identifier: accumulateIfStale
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void accumulateIfStale()
focal_class.class_method_signature: RollingHistogram.accumulate()
focal_class.full_signature: private void accumulate()
focal_class.identifier: accumulate
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void accumulate()
focal_class.class_method_signature: RollingHistogram.currentHistogram()
focal_class.full_signature: private DoubleRecorder currentHistogram()
focal_class.identifier: currentHistogram
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: DoubleRecorder
focal_class.signature: DoubleRecorder currentHistogram()
focal_method.body: public Snapshot getSnapshot() {
          rotate();
          synchronized (this) {
              accumulateIfStale();
              PercentileValue[] percentileValues = null;
              final double[] monitoredPercentiles = statisticConfig.getPercentiles();
              if (monitoredPercentiles != null) {
                  percentileValues = new PercentileValue[monitoredPercentiles.length];
                  for (int i = 0; i < monitoredPercentiles.length; i++) {
                      final double p = monitoredPercentiles[i];
                      percentileValues[i] = new PercentileValue(p, accumulatedHistogram.getValueAtPercentile(p * 100));
                  }
              }
              return new Snapshot(statisticConfig.getTimeWindow(),
                      accumulatedHistogram.getMinValue(),
                      accumulatedHistogram.getMean(),
                      accumulatedHistogram.getStdDeviation(),
                      accumulatedHistogram.getMaxValue(),
                      percentileValues);
          }
      }
focal_method.class_method_signature: RollingHistogram.getSnapshot()
focal_method.full_signature: public Snapshot getSnapshot()
focal_method.identifier: getSnapshot
focal_method.invocations: rotate accumulateIfStale getPercentiles getValueAtPercentile getTimeWindow getMinValue getMean getStdDeviation getMaxValue
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Snapshot
focal_method.signature: Snapshot getSnapshot()