MetricsUtils { public static void addLatency(Map<String, List<Double>> stats, String id, double lat) { List<Double> latList = stats.get(id); if (null == latList) { latList = new LinkedList<Double>(); stats.put(id, latList); } latList.add(lat); } private  MetricsUtils(); static void addLatency(Map<String, List<Double>> stats, String id, double lat); static TopologySummary getTopologySummary(ClusterSummary cs, String name); static double getSpoutCompleteLatency(SpoutStats stats, String window, String stream); static long getSpoutAcked(SpoutStats stats, String window, String stream); static long getTransferred(ExecutorStats stats, String window, String stream); static double getThroughput(double throughputDiff, long timeDiff); static double getThroughputMB(double throughputDiff, long timeDiff, int msgSize);  }
@Test public void testAddLatency() { Map<String, List<Double>> stats = Maps.newHashMap(); String id = "spout"; double lat = 0.01; MetricsUtils.addLatency(stats, id, lat); assertThat(stats).containsKey(id); assertThat(stats.get(id)).isNotNull().contains(lat); }