test_class.declarator: executorService = Executors.newSingleThreadScheduledExecutor()
test_class.modifier: private
test_class.original_string: private ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
test_class.type: ScheduledExecutorService
test_class.var_name: executorService
test_class.file: oak-core-spi/src/test/java/org/apache/jackrabbit/oak/stats/StatisticManagerTest.java
test_class.identifier: StatisticManagerTest
test_case.body: @Test
      public void observationQueueMaxLength() {
          AtomicLong maxQueueLength = new AtomicLong();
          SimpleStats stats = new SimpleStats(maxQueueLength, SimpleStats.Type.COUNTER);
          Whiteboard wb = new DefaultWhiteboard();
          wb.register(StatisticsProvider.class, new DummyStatsProvider() {
              @Override
              public CounterStats getCounterStats(String name,
                                                  StatsOptions options) {
                  if (name.equals(RepositoryStats.OBSERVATION_QUEUE_MAX_LENGTH)) {
                      return stats;
                  }
                  return super.getCounterStats(name, options);
              }
          }, null);
          StatisticManager mgr = new StatisticManager(wb, executorService);
  
          TimeSeriesMax rec = mgr.maxQueLengthRecorder();
          List<Runnable> services = wb.track(Runnable.class).getServices();
          assertEquals(1, services.size());
          // this is the scheduled task registered by the StatisticsManager
          // updating the TimeSeries every second
          Runnable pulse = services.get(0);
  
          // must reset the stats to 'unknown' (-1)
          pulse.run();
          assertEquals(-1L, maxQueueLength.get());
  
          rec.recordValue(7);
          rec.recordValue(5);
          rec.recordValue(-1);
  
          // must return the max value
          assertEquals(7L, maxQueueLength.get());
  
          // must reset the stats to 'unknown' (-1)
          pulse.run();
          assertEquals(-1L, maxQueueLength.get());
      }
test_case.class_method_signature: StatisticManagerTest.observationQueueMaxLength()
test_case.full_signature: @Test public void observationQueueMaxLength()
test_case.identifier: observationQueueMaxLength
test_case.invocations: register equals getCounterStats maxQueLengthRecorder getServices track assertEquals size get run assertEquals get recordValue recordValue recordValue assertEquals get run assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void observationQueueMaxLength()
focal_class.declarator: queryStat = new QueryStatImpl()
focal_class.modifier: private final
focal_class.original_string: private final QueryStatImpl queryStat = new QueryStatImpl();
focal_class.type: QueryStatImpl
focal_class.var_name: queryStat
focal_class.declarator: repoStats
focal_class.modifier: private final
focal_class.original_string: private final StatisticsProvider repoStats;
focal_class.type: StatisticsProvider
focal_class.var_name: repoStats
focal_class.declarator: maxQueueLength
focal_class.modifier: private final
focal_class.original_string: private final TimeSeriesMax maxQueueLength;
focal_class.type: TimeSeriesMax
focal_class.var_name: maxQueueLength
focal_class.declarator: maxQueueLengthCounter
focal_class.modifier: private final
focal_class.original_string: private final CounterStats maxQueueLengthCounter;
focal_class.type: CounterStats
focal_class.var_name: maxQueueLengthCounter
focal_class.declarator: registration
focal_class.modifier: private final
focal_class.original_string: private final CompositeRegistration registration;
focal_class.type: CompositeRegistration
focal_class.var_name: registration
focal_class.declarator: NOOP_METRIC_TYPES = EnumSet.of(
              Type.SESSION_READ_COUNTER,
              Type.SESSION_READ_DURATION,
              Type.SESSION_WRITE_DURATION,
              Type.QUERY_COUNT
      )
focal_class.modifier: private static final
focal_class.original_string: private static final EnumSet<Type> NOOP_METRIC_TYPES = EnumSet.of(
              Type.SESSION_READ_COUNTER,
              Type.SESSION_READ_DURATION,
              Type.SESSION_WRITE_DURATION,
              Type.QUERY_COUNT
      );
focal_class.type: EnumSet<Type>
focal_class.var_name: NOOP_METRIC_TYPES
focal_class.file: oak-core-spi/src/main/java/org/apache/jackrabbit/oak/stats/StatisticManager.java
focal_class.identifier: StatisticManager
focal_class.class_method_signature: StatisticManager.StatisticManager(Whiteboard whiteboard, ScheduledExecutorService executor)
focal_class.full_signature: public  StatisticManager(Whiteboard whiteboard, ScheduledExecutorService executor)
focal_class.identifier: StatisticManager
focal_class.modifiers: public
focal_class.parameters: (Whiteboard whiteboard, ScheduledExecutorService executor)
focal_class.signature:  StatisticManager(Whiteboard whiteboard, ScheduledExecutorService executor)
focal_class.class_method_signature: StatisticManager.logQueryEvaluationTime(String language, String statement, long millis)
focal_class.full_signature: public void logQueryEvaluationTime(String language, String statement, long millis)
focal_class.identifier: logQueryEvaluationTime
focal_class.modifiers: public
focal_class.parameters: (String language, String statement, long millis)
focal_class.return: void
focal_class.signature: void logQueryEvaluationTime(String language, String statement, long millis)
focal_class.class_method_signature: StatisticManager.getMeter(Type type)
focal_class.full_signature: public MeterStats getMeter(Type type)
focal_class.identifier: getMeter
focal_class.modifiers: public
focal_class.parameters: (Type type)
focal_class.return: MeterStats
focal_class.signature: MeterStats getMeter(Type type)
focal_class.class_method_signature: StatisticManager.getStatsCounter(Type type)
focal_class.full_signature: public CounterStats getStatsCounter(Type type)
focal_class.identifier: getStatsCounter
focal_class.modifiers: public
focal_class.parameters: (Type type)
focal_class.return: CounterStats
focal_class.signature: CounterStats getStatsCounter(Type type)
focal_class.class_method_signature: StatisticManager.getTimer(Type type)
focal_class.full_signature: public TimerStats getTimer(Type type)
focal_class.identifier: getTimer
focal_class.modifiers: public
focal_class.parameters: (Type type)
focal_class.return: TimerStats
focal_class.signature: TimerStats getTimer(Type type)
focal_class.class_method_signature: StatisticManager.maxQueLengthRecorder()
focal_class.full_signature: public TimeSeriesMax maxQueLengthRecorder()
focal_class.identifier: maxQueLengthRecorder
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TimeSeriesMax
focal_class.signature: TimeSeriesMax maxQueLengthRecorder()
focal_class.class_method_signature: StatisticManager.dispose()
focal_class.full_signature: public void dispose()
focal_class.identifier: dispose
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void dispose()
focal_class.class_method_signature: StatisticManager.getStatsProvider(Whiteboard wb,
                                                  ScheduledExecutorService executor)
focal_class.full_signature: private StatisticsProvider getStatsProvider(Whiteboard wb,
                                                  ScheduledExecutorService executor)
focal_class.identifier: getStatsProvider
focal_class.modifiers: private
focal_class.parameters: (Whiteboard wb,
                                                  ScheduledExecutorService executor)
focal_class.return: StatisticsProvider
focal_class.signature: StatisticsProvider getStatsProvider(Whiteboard wb,
                                                  ScheduledExecutorService executor)
focal_class.class_method_signature: StatisticManager.getOption(Type type)
focal_class.full_signature: private static StatsOptions getOption(Type type)
focal_class.identifier: getOption
focal_class.modifiers: private static
focal_class.parameters: (Type type)
focal_class.return: StatsOptions
focal_class.signature: StatsOptions getOption(Type type)
focal_method.body: public TimeSeriesMax maxQueLengthRecorder() {
          return maxQueueLength;
      }
focal_method.class_method_signature: StatisticManager.maxQueLengthRecorder()
focal_method.full_signature: public TimeSeriesMax maxQueLengthRecorder()
focal_method.identifier: maxQueLengthRecorder
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: TimeSeriesMax
focal_method.signature: TimeSeriesMax maxQueLengthRecorder()