Skip to content

Commit

Permalink
Merge pull request #9 from styleseat/call-cloudwatch-directly
Browse files Browse the repository at this point in the history
Just send the metric when `incr_meter` is called.
  • Loading branch information
Lanny authored Nov 6, 2020
2 parents 6b5ddaa + 6b85aba commit 9803ea0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
)

setup(name='ss_instrumentation',
version='0.1',
version='1.1.0',
description='',
url='https://github.com/styleseat/ss-instrumentation',
author='Some Dude at StyleSeat',
Expand Down
5 changes: 3 additions & 2 deletions src/ss_instrumentation/SSInstrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def __init__(self, config, storage=None):
self._storage = InMemoryMetricStorage()

def incr_meter(self, metric_name, **dims):
metric = MetricAndDims(metric_name, **dims)
self._storage.incr(metric)
# metric = MetricAndDims(metric_name, **dims)
# self._storage.incr(metric)
self.put_metric(metric_name, 1, **dims)

def put_metric(self, metric_name, value, **kwargs):
data = {
Expand Down
3 changes: 3 additions & 0 deletions test/SSInstrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from freezegun import freeze_time
import mock
import pytest

from ss_instrumentation import (
SSInstrumentation,
Expand Down Expand Up @@ -95,6 +96,7 @@ def test_put_metric_with_dims(self, mock_client):
}
)

@pytest.mark.skip(reason='We\'re trying this out without the redis part')
@standard_mock
def test_simple_meter(self, mock_client):
with freeze_time(datetime.utcnow()) as frozen_datetime:
Expand Down Expand Up @@ -125,6 +127,7 @@ def test_simple_meter(self, mock_client):
]
)

@pytest.mark.skip(reason='We\'re trying this out without the redis part')
@standard_mock
def test_meter_w_dims(self, mock_client):
with freeze_time(datetime.utcnow()) as frozen_datetime:
Expand Down

0 comments on commit 9803ea0

Please sign in to comment.