@Test public void testMultiThreadedSingleMetricsInterceptorInstance() throws Exception { LifecycleHelper.init(metricsInterceptor); LifecycleHelper.start(metricsInterceptor); new MetricsInserterThread(20).run(); new MetricsInserterThread(20).run(); new MetricsInserterThread(20).run(); new MetricsInserterThread(20).run(); new MetricsInserterThread(20).run(); Thread.sleep(200); assertEquals(1000, ((MetadataStatistic) metricsInterceptor.getStats().get(0)).getValue(COUNTER_1)); assertEquals(1000, ((MetadataStatistic) metricsInterceptor.getStats().get(0)).getValue(COUNTER_2)); }
private int getValue(String key, AdaptrisMessage msg) { if (!msg.headersContainsKey(key)) { return 0; } return Integer.parseInt(msg.getMetadataValue(key)); }
MetadataTotalsInterceptor extends MetadataMetricsInterceptorImpl { private int getValue(String key, AdaptrisMessage msg) { if (!msg.headersContainsKey(key)) { return 0; } return Integer.parseInt(msg.getMetadataValue(key)); } }
MetadataTotalsInterceptor extends MetadataMetricsInterceptorImpl { private int getValue(String key, AdaptrisMessage msg) { if (!msg.headersContainsKey(key)) { return 0; } return Integer.parseInt(msg.getMetadataValue(key)); } MetadataTotalsInterceptor();  MetadataTotalsInterceptor(List<String> keys); }
MetadataTotalsInterceptor extends MetadataMetricsInterceptorImpl { private int getValue(String key, AdaptrisMessage msg) { if (!msg.headersContainsKey(key)) { return 0; } return Integer.parseInt(msg.getMetadataValue(key)); } MetadataTotalsInterceptor();  MetadataTotalsInterceptor(List<String> keys); @Override synchronized void workflowStart(AdaptrisMessage inputMsg); @Override synchronized void workflowEnd(AdaptrisMessage inputMsg, final AdaptrisMessage outputMsg); List<String> getMetadataKeys(); void setMetadataKeys(List<String> l); }
MetadataTotalsInterceptor extends MetadataMetricsInterceptorImpl { private int getValue(String key, AdaptrisMessage msg) { if (!msg.headersContainsKey(key)) { return 0; } return Integer.parseInt(msg.getMetadataValue(key)); } MetadataTotalsInterceptor();  MetadataTotalsInterceptor(List<String> keys); @Override synchronized void workflowStart(AdaptrisMessage inputMsg); @Override synchronized void workflowEnd(AdaptrisMessage inputMsg, final AdaptrisMessage outputMsg); List<String> getMetadataKeys(); void setMetadataKeys(List<String> l);  }