(self)
| 300 | self.assertEqualMetrics([metric_family], list(families)) |
| 301 | |
| 302 | def test_timestamps(self): |
| 303 | families = text_string_to_metric_families("""# TYPE a counter |
| 304 | # HELP a help |
| 305 | a{foo="bar"} 1\t000 |
| 306 | # TYPE b counter |
| 307 | # HELP b help |
| 308 | b 2 1234567890 |
| 309 | b 88 1234566000 |
| 310 | """) |
| 311 | a = CounterMetricFamily("a", "help", labels=["foo"]) |
| 312 | a.add_metric(["bar"], 1, timestamp=0) |
| 313 | b = CounterMetricFamily("b", "help") |
| 314 | b.add_metric([], 2, timestamp=1234567.89) |
| 315 | b.add_metric([], 88, timestamp=1234566) |
| 316 | self.assertEqualMetrics([a, b], list(families)) |
| 317 | |
| 318 | def test_roundtrip(self): |
| 319 | text = """# HELP go_gc_duration_seconds A summary of the GC invocation durations. |
nothing calls this directly
no test coverage detected