def test_prometheus_client_not_installed(self, app, monkeypatch): monkeypatch.setattr("faust.sensors.prometheus.prometheus_client", None) with pytest.raises(ImproperlyConfigured): PrometheusMonitor(app)
def monitor(self, metrics: FaustMetrics) -> PrometheusMonitor: return PrometheusMonitor(metrics=metrics, time=_time)
def prometheus_client(self, app, counter, gauge, histogram, time=None): time = time or self.time() return PrometheusMonitor(app, time=time)