test_class.declarator: server = ManagementFactory.getPlatformMBeanServer()
test_class.modifier: private
test_class.original_string: private MBeanServer server = ManagementFactory.getPlatformMBeanServer();
test_class.type: MBeanServer
test_class.var_name: server
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.declarator: statsProvider = new MetricStatisticsProvider(server, executorService)
test_class.modifier: private
test_class.original_string: private MetricStatisticsProvider statsProvider = new MetricStatisticsProvider(server, executorService);
test_class.type: MetricStatisticsProvider
test_class.var_name: statsProvider
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/metric/MetricStatisticsProviderTest.java
test_class.identifier: MetricStatisticsProviderTest
test_case.body: @Test
      public void concurrentAccess() throws Exception{
          //Queue is used to collect instances with minimal overhead in concurrent scenario
          final Queue<MeterStats> statsQueue = new ConcurrentLinkedDeque<MeterStats>();
          List<Thread> threads = Lists.newArrayList();
          int numWorker = 5;
          final CountDownLatch latch = new CountDownLatch(1);
          for (int i = 0; i < numWorker; i++) {
              threads.add(new Thread(new Runnable() {
                  @Override
                  public void run() {
                      Uninterruptibles.awaitUninterruptibly(latch);
                      statsQueue.add(statsProvider.getMeter("foo", StatsOptions.DEFAULT));
                  }
              }));
          }
  
          for (Thread t : threads){
              t.start();
          }
  
          latch.countDown();
  
          for (Thread t : threads){
              t.join();
          }
  
          //Assert that we get same reference for every call
          Set<MeterStats> statsSet = Sets.newIdentityHashSet();
  
          for (MeterStats m : statsQueue){
              statsSet.add(m);
          }
  
          assertEquals(1, statsSet.size());
  
      }
test_case.class_method_signature: MetricStatisticsProviderTest.concurrentAccess()
test_case.full_signature: @Test public void concurrentAccess()
test_case.identifier: concurrentAccess
test_case.invocations: newArrayList add awaitUninterruptibly add getMeter start countDown join newIdentityHashSet add assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void concurrentAccess()
focal_class.declarator: log = LoggerFactory.getLogger(MetricStatisticsProvider.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(MetricStatisticsProvider.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: JMX_TYPE_METRICS = "Metrics"
focal_class.modifier: private static final
focal_class.original_string: private static final String JMX_TYPE_METRICS = "Metrics";
focal_class.type: String
focal_class.var_name: JMX_TYPE_METRICS
focal_class.declarator: statsRegistry = Maps.newConcurrentMap()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<String, Stats> statsRegistry = Maps.newConcurrentMap();
focal_class.type: ConcurrentMap<String, Stats>
focal_class.var_name: statsRegistry
focal_class.declarator: registry
focal_class.modifier: private final
focal_class.original_string: private final MetricRegistry registry;
focal_class.type: MetricRegistry
focal_class.var_name: registry
focal_class.declarator: reporter
focal_class.modifier: private final
focal_class.original_string: private final JmxReporter reporter;
focal_class.type: JmxReporter
focal_class.var_name: reporter
focal_class.declarator: repoStats
focal_class.modifier: private final
focal_class.original_string: private final RepositoryStatisticsImpl repoStats;
focal_class.type: RepositoryStatisticsImpl
focal_class.var_name: repoStats
focal_class.declarator: clock
focal_class.modifier: private final
focal_class.original_string: private final Clock.Fast clock;
focal_class.type: Clock.Fast
focal_class.var_name: clock
focal_class.declarator: metricsClock
focal_class.modifier: private final
focal_class.original_string: private final com.codahale.metrics.Clock metricsClock;
focal_class.type: com.codahale.metrics.Clock
focal_class.var_name: metricsClock
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/metric/MetricStatisticsProvider.java
focal_class.identifier: MetricStatisticsProvider
focal_class.interfaces: implements StatisticsProvider, Closeable
focal_class.class_method_signature: MetricStatisticsProvider.MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor)
focal_class.full_signature: public  MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor)
focal_class.identifier: MetricStatisticsProvider
focal_class.modifiers: public
focal_class.parameters: (MBeanServer server, ScheduledExecutorService executor)
focal_class.signature:  MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor)
focal_class.class_method_signature: MetricStatisticsProvider.typeToName(Type type)
focal_class.full_signature: static String typeToName(Type type)
focal_class.identifier: typeToName
focal_class.modifiers: static
focal_class.parameters: (Type type)
focal_class.return: String
focal_class.signature: String typeToName(Type type)
focal_class.class_method_signature: MetricStatisticsProvider.close()
focal_class.full_signature: public void close()
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: MetricStatisticsProvider.getStats()
focal_class.full_signature: @Override public RepositoryStatistics getStats()
focal_class.identifier: getStats
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: RepositoryStatistics
focal_class.signature: RepositoryStatistics getStats()
focal_class.class_method_signature: MetricStatisticsProvider.getMeter(String name, StatsOptions options)
focal_class.full_signature: @Override public MeterStats getMeter(String name, StatsOptions options)
focal_class.identifier: getMeter
focal_class.modifiers: @Override public
focal_class.parameters: (String name, StatsOptions options)
focal_class.return: MeterStats
focal_class.signature: MeterStats getMeter(String name, StatsOptions options)
focal_class.class_method_signature: MetricStatisticsProvider.getCounterStats(String name, StatsOptions options)
focal_class.full_signature: @Override public CounterStats getCounterStats(String name, StatsOptions options)
focal_class.identifier: getCounterStats
focal_class.modifiers: @Override public
focal_class.parameters: (String name, StatsOptions options)
focal_class.return: CounterStats
focal_class.signature: CounterStats getCounterStats(String name, StatsOptions options)
focal_class.class_method_signature: MetricStatisticsProvider.getTimer(String name, StatsOptions options)
focal_class.full_signature: @Override public TimerStats getTimer(String name, StatsOptions options)
focal_class.identifier: getTimer
focal_class.modifiers: @Override public
focal_class.parameters: (String name, StatsOptions options)
focal_class.return: TimerStats
focal_class.signature: TimerStats getTimer(String name, StatsOptions options)
focal_class.class_method_signature: MetricStatisticsProvider.getHistogram(String name, StatsOptions options)
focal_class.full_signature: @Override public HistogramStats getHistogram(String name, StatsOptions options)
focal_class.identifier: getHistogram
focal_class.modifiers: @Override public
focal_class.parameters: (String name, StatsOptions options)
focal_class.return: HistogramStats
focal_class.signature: HistogramStats getHistogram(String name, StatsOptions options)
focal_class.class_method_signature: MetricStatisticsProvider.getRegistry()
focal_class.full_signature: public MetricRegistry getRegistry()
focal_class.identifier: getRegistry
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: MetricRegistry
focal_class.signature: MetricRegistry getRegistry()
focal_class.class_method_signature: MetricStatisticsProvider.getRepoStats()
focal_class.full_signature:  RepositoryStatisticsImpl getRepoStats()
focal_class.identifier: getRepoStats
focal_class.parameters: ()
focal_class.return: RepositoryStatisticsImpl
focal_class.signature: RepositoryStatisticsImpl getRepoStats()
focal_class.class_method_signature: MetricStatisticsProvider.getStats(String name, StatsBuilder<T> builder, StatsOptions options)
focal_class.full_signature: private T getStats(String name, StatsBuilder<T> builder, StatsOptions options)
focal_class.identifier: getStats
focal_class.modifiers: private
focal_class.parameters: (String name, StatsBuilder<T> builder, StatsOptions options)
focal_class.return: T
focal_class.signature: T getStats(String name, StatsBuilder<T> builder, StatsOptions options)
focal_class.class_method_signature: MetricStatisticsProvider.getTimerSeriesStats(String name, StatsBuilder builder)
focal_class.full_signature: private AtomicLong getTimerSeriesStats(String name, StatsBuilder builder)
focal_class.identifier: getTimerSeriesStats
focal_class.modifiers: private
focal_class.parameters: (String name, StatsBuilder builder)
focal_class.return: AtomicLong
focal_class.signature: AtomicLong getTimerSeriesStats(String name, StatsBuilder builder)
focal_class.class_method_signature: MetricStatisticsProvider.registerAverages()
focal_class.full_signature: private void registerAverages()
focal_class.identifier: registerAverages
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void registerAverages()
focal_class.class_method_signature: MetricStatisticsProvider.compStats(Type type, StatsBuilder builder)
focal_class.full_signature: private CompositeStats compStats(Type type, StatsBuilder builder)
focal_class.identifier: compStats
focal_class.modifiers: private
focal_class.parameters: (Type type, StatsBuilder builder)
focal_class.return: CompositeStats
focal_class.signature: CompositeStats compStats(Type type, StatsBuilder builder)
focal_method.body: @Override
      public MeterStats getMeter(String name, StatsOptions options) {
          return getStats(name, StatsBuilder.METERS, options);
      }
focal_method.class_method_signature: MetricStatisticsProvider.getMeter(String name, StatsOptions options)
focal_method.full_signature: @Override public MeterStats getMeter(String name, StatsOptions options)
focal_method.identifier: getMeter
focal_method.invocations: getStats
focal_method.modifiers: @Override public
focal_method.parameters: (String name, StatsOptions options)
focal_method.return: MeterStats
focal_method.signature: MeterStats getMeter(String name, StatsOptions options)