@Test public void getEmptyMetric() { assertThat(metrics.getMetrics("test")).isNull(); }
@Nullable public Metrics getMetrics(@NonNull String name) { Deque<Metrics> metrics = metricsMap.get(name.trim()); synchronized (this) { return metrics != null && !metrics.isEmpty() ? metrics.pop() : null; } }
AbstractCompositeMetrics { @Nullable public Metrics getMetrics(@NonNull String name) { Deque<Metrics> metrics = metricsMap.get(name.trim()); synchronized (this) { return metrics != null && !metrics.isEmpty() ? metrics.pop() : null; } } }
AbstractCompositeMetrics { @Nullable public Metrics getMetrics(@NonNull String name) { Deque<Metrics> metrics = metricsMap.get(name.trim()); synchronized (this) { return metrics != null && !metrics.isEmpty() ? metrics.pop() : null; } } AbstractCompositeMetrics(long maxLength); }
AbstractCompositeMetrics { @Nullable public Metrics getMetrics(@NonNull String name) { Deque<Metrics> metrics = metricsMap.get(name.trim()); synchronized (this) { return metrics != null && !metrics.isEmpty() ? metrics.pop() : null; } } AbstractCompositeMetrics(long maxLength); void add(String name, long delta); @Nullable Metrics getMetrics(@NonNull String name); }
AbstractCompositeMetrics { @Nullable public Metrics getMetrics(@NonNull String name) { Deque<Metrics> metrics = metricsMap.get(name.trim()); synchronized (this) { return metrics != null && !metrics.isEmpty() ? metrics.pop() : null; } } AbstractCompositeMetrics(long maxLength); void add(String name, long delta); @Nullable Metrics getMetrics(@NonNull String name);  }