Ejemplo n.º 1
0
    def test_get_all_histograms(self):
        mm = MetricManager()
        mr = BaseMetricsReporter()
        mm.setup_reporters(mr)

        # test default implementation
        for hist in mm.histograms():
            self.assertIsNotNone(get_method_self(hist))
            self.assertIsInstance(get_method_self(hist), MetricsRegistry)

        # test context aware
        for hist in mm.histograms('test'):
            from pyformance.meters.histogram import Histogram
            self.assertIsInstance(hist, Histogram)