@Test( timeout = 2000 ) public void testConcurrencySnap() throws Exception { ExecutorService service = Executors.newFixedThreadPool( threadCount ); for ( int i = 0; i < threadCount; i++ ) { service.submit( new ConcurrentPutIfAbsent( logIds.get( i % 20 ) ) ); } countDownLatch.countDown(); service.shutdown(); while ( !service.isTerminated() ) { Thread.currentThread().sleep( 1 ); } int expectedQueueCount = logChannelIdCount > threadCount ? threadCount : logChannelIdCount; assertTrue( expectedQueueCount == metricsRegistry.getSnapshotLists().size() ); }
public Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists() { return snapshotLists; }
MetricsRegistry { public Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists() { return snapshotLists; } }
MetricsRegistry { public Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists() { return snapshotLists; } private  MetricsRegistry(); }
MetricsRegistry { public Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists() { return snapshotLists; } private  MetricsRegistry(); static MetricsRegistry getInstance(); void addSnapshot( LogChannelInterface logChannel, MetricsSnapshotInterface snapshot ); Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists(); Map<String, Map<String, MetricsSnapshotInterface>> getSnapshotMaps(); Queue<MetricsSnapshotInterface> getSnapshotList( String logChannelId ); Map<String, MetricsSnapshotInterface> getSnapshotMap( String logChannelId ); }
MetricsRegistry { public Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists() { return snapshotLists; } private  MetricsRegistry(); static MetricsRegistry getInstance(); void addSnapshot( LogChannelInterface logChannel, MetricsSnapshotInterface snapshot ); Map<String, Queue<MetricsSnapshotInterface>> getSnapshotLists(); Map<String, Map<String, MetricsSnapshotInterface>> getSnapshotMaps(); Queue<MetricsSnapshotInterface> getSnapshotList( String logChannelId ); Map<String, MetricsSnapshotInterface> getSnapshotMap( String logChannelId );  }