@Test 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.awaitTermination( 2000, TimeUnit.MILLISECONDS ); int expectedQueueCount = logChannelIdCount > threadCount ? threadCount : logChannelIdCount; assertEquals( 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 ); void reset(); }
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 ); void reset();  }