MCPcopy Create free account
hub / github.com/prometheus/client_python / test_info_labels

Method test_info_labels

tests/test_core.py:847–851  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

845 self.assertEqual(1, self.registry.get_sample_value('i_info', {'a': 'b'}))
846
847 def test_info_labels(self):
848 cmf = InfoMetricFamily('i', 'help', labels=['a'])
849 cmf.add_metric(['b'], {'c': 'd'})
850 self.custom_collector(cmf)
851 self.assertEqual(1, self.registry.get_sample_value('i_info', {'a': 'b', 'c': 'd'}))
852
853 def test_stateset(self):
854 self.custom_collector(StateSetMetricFamily('s', 'help', value={'a': True, 'b': True, }))

Callers

nothing calls this directly

Calls 4

add_metricMethod · 0.95
custom_collectorMethod · 0.95
InfoMetricFamilyClass · 0.90
get_sample_valueMethod · 0.80

Tested by

no test coverage detected