Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 def test_gauge_with_tag(self):
     with pytest.raises(ValueError):
         statsdecor.gauge('a.metric', value=DEFAULT_VALUE, tags=self.tags)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
def test_gauge():
    with stub_client() as stub:
        statsdecor.gauge('a.metric', 8)
        stub.client.gauge.assert_called_with('a.metric', 8, 1)
Ejemplo n.º 6
0
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)
Ejemplo n.º 7
0
def test_gauge():
    with stub_client() as stub:
        statsdecor.gauge('a.metric', 8)
        stub.client.gauge.assert_called_with('a.metric', 8, 1)