Merge "Ignore sending null values from shaker output to Elasticsearch"

This commit is contained in:
Jenkins 2016-09-30 12:11:46 +00:00 committed by Gerrit Code Review
commit 9f86c4f45c
2 changed files with 7 additions and 4 deletions

View File

@ -96,8 +96,8 @@ class Elastic(object):
doc_type=_type,
refresh=True)
self.logger.info("Pushed data to Elasticsearch to index {}"
" and browbeat UUID {}" .format(self.index,
result['browbeat_uuid']))
" and browbeat UUID {}" .format(self.index,
result['browbeat_uuid']))
break
except Exception:
self.logger.error("Error pushing data to Elasticsearch, going to retry"

View File

@ -172,8 +172,11 @@ class Shaker(WorkloadBase.WorkloadBase):
self.grafana.grafana_urls()],
'shaker_uuid': str(shaker_uuid)}
# Ship Data to ES when record status is ok
result = self.elastic.combine_metadata(shaker_stats)
self.elastic.index_result(result, test_name)
if result['value'] is None:
self.logger.debug("Ignoring sending null values to ES")
else:
result = self.elastic.combine_metadata(shaker_stats)
self.elastic.index_result(result, test_name)
else:
# If the status of the record is not ok, ship minimal
# shaker_stats dictionary to ES