1515 */
1616package com .netflix .spectator .metrics5 ;
1717
18- import io .dropwizard .metrics5 .Gauge ;
1918import io .dropwizard .metrics5 .MetricName ;
2019import io .dropwizard .metrics5 .MetricRegistry ;
2120import com .netflix .spectator .api .ManualClock ;
2423import org .junit .jupiter .api .Assertions ;
2524import org .junit .jupiter .api .Test ;
2625
27- import java .util .*;
26+ import java .util .Collections ;
27+ import java .util .HashMap ;
28+ import java .util .HashSet ;
29+ import java .util .Map ;
30+ import java .util .Set ;
2831import java .util .concurrent .TimeUnit ;
2932import java .util .concurrent .atomic .AtomicInteger ;
3033
@@ -49,31 +52,31 @@ public void counter() {
4952 MetricRegistry dwRegistry = new MetricRegistry ();
5053 MetricsRegistry r = new MetricsRegistry (clock , dwRegistry );
5154 r .counter ("foo" ).increment ();
52- Assertions .assertEquals (1 , dwRegistry .getMeters ().get (new MetricName ("foo" , Collections .EMPTY_MAP )).getCount ());
55+ Assertions .assertEquals (1 , dwRegistry .getMeters ().get (new MetricName ("foo" , Collections .emptyMap () )).getCount ());
5356 r .counter ("foo" ).increment (15 );
54- Assertions .assertEquals (16 , dwRegistry .getMeters ().get (new MetricName ("foo" , Collections .EMPTY_MAP )).getCount ());
57+ Assertions .assertEquals (16 , dwRegistry .getMeters ().get (new MetricName ("foo" , Collections .emptyMap () )).getCount ());
5558 }
5659
5760 @ Test
5861 public void timer () {
5962 MetricRegistry dwRegistry = new MetricRegistry ();
6063 MetricsRegistry r = new MetricsRegistry (clock , dwRegistry );
6164 r .timer ("foo" ).record (1 , TimeUnit .MILLISECONDS );
62- Assertions .assertEquals (1 , dwRegistry .getTimers ().get (new MetricName ("foo" , Collections .EMPTY_MAP )).getCount ());
65+ Assertions .assertEquals (1 , dwRegistry .getTimers ().get (new MetricName ("foo" , Collections .emptyMap () )).getCount ());
6366 }
6467
6568 @ Test
6669 public void distributionSummary () {
6770 MetricRegistry dwRegistry = new MetricRegistry ();
6871 MetricsRegistry r = new MetricsRegistry (clock , dwRegistry );
6972 r .distributionSummary ("foo" ).record (1 );
70- Assertions .assertEquals (1 , dwRegistry .getHistograms ().get (new MetricName ("foo" , Collections .EMPTY_MAP )).getCount ());
73+ Assertions .assertEquals (1 , dwRegistry .getHistograms ().get (new MetricName ("foo" , Collections .emptyMap () )).getCount ());
7174 }
7275
7376 private void assertGaugeValue (
7477 MetricsRegistry r , MetricRegistry dwRegistry , String name , double expected ) {
7578 PolledMeter .update (r );
76- Assertions .assertEquals (expected , (Double ) dwRegistry .getGauges ().get (new MetricName (name , Collections .EMPTY_MAP )).getValue (), 1e-12 );
79+ Assertions .assertEquals (expected , (Double ) dwRegistry .getGauges ().get (new MetricName (name , Collections .emptyMap () )).getValue (), 1e-12 );
7780 }
7881
7982 @ Test
@@ -123,7 +126,7 @@ public void gaugeRegisteredDirectly() throws Exception {
123126 AtomicInteger num = r .gauge ("foo" , new AtomicInteger (42 ));
124127
125128 // Should be registered with the Dropwizard registry
126- Assertions .assertEquals (42.0 , (Double ) dwRegistry .getGauges ().get (new MetricName ("foo" , Collections .EMPTY_MAP )).getValue (), 1e-12 );
129+ Assertions .assertEquals (42.0 , (Double ) dwRegistry .getGauges ().get (new MetricName ("foo" , Collections .emptyMap () )).getValue (), 1e-12 );
127130
128131 // Should not be registered with spectator
129132 Assertions .assertNull (r .get (r .createId ("foo" )));
0 commit comments