DefaultTunnelSocketStatsAnalyzerManager extends AbstractStartStoppable implements TunnelSocketStatsAnalyzerManager { @Override public List<TunnelSocketStatsAnalyzer.FrontendAndBackendMetrics> analyze(ProxyChain chain) { List<TunnelSocketStatsAnalyzer.FrontendAndBackendMetrics> result = Lists.newArrayList(); new SafeLoop<TunnelSocketStatsAnalyzer>(analyzers.values()) { @Override protected void doRun0(TunnelSocketStatsAnalyzer analyzer) { result.addAll(analyzer.analyze(chain)); } }.run(); return result; }  @PostConstruct void postConstruct(); @Override List<TunnelSocketStatsAnalyzer.FrontendAndBackendMetrics> analyze(ProxyChain chain); @Override TunnelSocketStatsMetricOverview analyze(TunnelSocketStatsResult result); @Override List<String> getMetricTypes();  }
@Test public void testAnalyze() { List<TunnelSocketStatsAnalyzer.FrontendAndBackendMetrics> result = manager.analyze(new DefaultProxyChain("FRA-AWS", "cluster", "shard", Lists.newArrayList( tunnelInfo1(), tunnelInfo2() ))); int index = 1; for(TunnelSocketStatsAnalyzer.FrontendAndBackendMetrics metric : result) { logger.info("tunnel-{}", index++); logger.info("frontend:"); logger.info("{}: {}", metric.getFrontend().getMetricType(), metric.getFrontend().getValue()); logger.info("backend:"); logger.info("{}: {}", metric.getBackend().getMetricType(), metric.getBackend().getValue()); } }