@@ -80,15 +80,20 @@ public void testMetricFamilySamples_filterNames() {
8080 Collector ec = new EmptyCollector ().register (registry );
8181 SkippedCollector sr = new SkippedCollector ().register (registry );
8282 PartiallyFilterCollector pfr = new PartiallyFilterCollector ().register (registry );
83- HashSet <String > names = new HashSet <String >();
83+ HashSet <String > metrics = new HashSet <String >();
84+ HashSet <String > series = new HashSet <String >();
8485 for (Collector .MetricFamilySamples metricFamilySamples : Collections .list (registry .filteredMetricFamilySamples (
85- new HashSet <String >(Arrays .asList ("" , "s" , "c" , "part_filter_a" , "part_filter_c" ))))) {
86- names .add (metricFamilySamples .name );
86+ new HashSet <String >(Arrays .asList ("" , "s_sum" , "c" , "part_filter_a" , "part_filter_c" ))))) {
87+ metrics .add (metricFamilySamples .name );
88+ for (Collector .MetricFamilySamples .Sample sample : metricFamilySamples .samples ) {
89+ series .add (sample .name );
90+ }
8791 }
8892
8993 assertEquals (1 , sr .collectCallCount );
9094 assertEquals (2 , pfr .collectCallCount );
91- assertEquals (new HashSet <String >(Arrays .asList ("s" , "c" , "part_filter_a" , "part_filter_c" )), names );
95+ assertEquals (new HashSet <String >(Arrays .asList ("s" , "c" , "part_filter_a" , "part_filter_c" )), metrics );
96+ assertEquals (new HashSet <String >(Arrays .asList ("s_sum" , "c" , "part_filter_a" , "part_filter_c" )), series );
9297 }
9398
9499 @ Test
0 commit comments