def test_gauge_no_tag(self, mocked_super): statsdecor.gauge('a.metric', value=DEFAULT_VALUE) mocked_super.assert_called_with(stat='a.metric', value=DEFAULT_VALUE, rate=DEFAULT_RATE)
def test_gauge_with_tag(self): with pytest.raises(ValueError): statsdecor.gauge('a.metric', value=DEFAULT_VALUE, tags=self.tags)
def test_gauge_with_tag(self, mocked_super): statsdecor.gauge('a.metric', value=DEFAULT_VALUE, tags=self.tags) mocked_super.assert_called_with(metric='a.metric', value=DEFAULT_VALUE, tags=self.tags, sample_rate=DEFAULT_RATE)
def test_gauge__with_value_and_rate(): with stub_client() as stub: statsdecor.gauge('a.metric', 9, 0.1) stub.client.gauge.assert_called_with('a.metric', 9, 0.1)
def test_gauge(): with stub_client() as stub: statsdecor.gauge('a.metric', 8) stub.client.gauge.assert_called_with('a.metric', 8, 1)