(self)
| 112 | """, generate_latest(self.registry)) |
| 113 | |
| 114 | def test_histogram(self): |
| 115 | s = Histogram('hh', 'A histogram', registry=self.registry) |
| 116 | s.observe(0.05) |
| 117 | self.assertEqual(b"""# HELP hh A histogram |
| 118 | # TYPE hh histogram |
| 119 | hh_bucket{le="0.005"} 0.0 |
| 120 | hh_bucket{le="0.01"} 0.0 |
| 121 | hh_bucket{le="0.025"} 0.0 |
| 122 | hh_bucket{le="0.05"} 1.0 |
| 123 | hh_bucket{le="0.075"} 1.0 |
| 124 | hh_bucket{le="0.1"} 1.0 |
| 125 | hh_bucket{le="0.25"} 1.0 |
| 126 | hh_bucket{le="0.5"} 1.0 |
| 127 | hh_bucket{le="0.75"} 1.0 |
| 128 | hh_bucket{le="1.0"} 1.0 |
| 129 | hh_bucket{le="2.5"} 1.0 |
| 130 | hh_bucket{le="5.0"} 1.0 |
| 131 | hh_bucket{le="7.5"} 1.0 |
| 132 | hh_bucket{le="10.0"} 1.0 |
| 133 | hh_bucket{le="+Inf"} 1.0 |
| 134 | hh_count 1.0 |
| 135 | hh_sum 0.05 |
| 136 | # HELP hh_created A histogram |
| 137 | # TYPE hh_created gauge |
| 138 | hh_created 123.456 |
| 139 | """, generate_latest(self.registry)) |
| 140 | |
| 141 | def test_gaugehistogram(self): |
| 142 | self.custom_collector(GaugeHistogramMetricFamily('gh', 'help', buckets=[('1.0', 4), ('+Inf', 5)], gsum_value=7)) |
nothing calls this directly
no test coverage detected