Skip to content

Commit

Permalink
Backend reports methods now return the result of reporting data
Browse files Browse the repository at this point in the history
  • Loading branch information
marctc committed Mar 28, 2016
1 parent 5266fba commit 415add3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kaneda/backends/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _get_index_name(self):
def report(self, name, metric, value, tags, id_):
payload = self._get_payload(name, value, tags)
try:
self.client.index(index=self._get_index_name(), doc_type=metric, id=id_, body=payload)
return self.client.index(index=self._get_index_name(), doc_type=metric, id=id_, body=payload)
except Exception as e:
logger = logging.getLogger(__name__)
logger.exception(e)
Expand Down
2 changes: 1 addition & 1 deletion kaneda/backends/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ def _get_payload(self, name, value, metric, tags, id_):

def report(self, name, metric, value, tags, id_):
payload = self._get_payload(name, value, metric, tags, id_)
self.logger.info(payload)
return self.logger.info(payload)

2 changes: 1 addition & 1 deletion kaneda/backends/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _get_payload(self, name, value, metric, tags, id_):
def report(self, name, metric, value, tags, id_):
payload = self._get_payload(name, value, metric, tags, id_)
try:
self.collection.insert_one(payload)
return self.collection.insert_one(payload)
except Exception as e:
logger = logging.getLogger(__name__)
logger.exception(e)
2 changes: 1 addition & 1 deletion kaneda/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ def get_user(user_id):
return self._TimedContextManagerDecorator(self, name, tags, use_ms)

def _report(self, name, metric, value, tags, id_=None):
self.backend.report(name, metric, value, tags, id_)
return self.backend.report(name, metric, value, tags, id_)

0 comments on commit 415add3

Please sign in to comment.