Skip to content

Commit

Permalink
Store Rally version in results meta-data
Browse files Browse the repository at this point in the history
Closes #411
  • Loading branch information
danielmitterdorfer committed Feb 5, 2018
1 parent 5a45715 commit 7bd62db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions esrally/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ def open(self, invocation=None, track_name=None, challenge_name=None, car_name=N
for k, v in user_tags.items():
# prefix user tag with "tag_" in order to avoid clashes with our internal meta data
self.add_meta_info(MetaInfoScope.cluster, None, "tag_%s" % k, v)
# Don't store it for each metrics record as it's probably sufficient on race level
# self.add_meta_info(MetaInfoScope.cluster, None, "rally_version", version.version())
self._stop_watch.start()
self.opened = True

Expand Down Expand Up @@ -1142,6 +1144,7 @@ def to_result_dicts(self):
:return: a list of dicts, suitable for persisting the results of this race in a format that is Kibana-friendly.
"""
result_template = {
"rally-version": self.rally_version,
"environment": self.environment_name,
"trial-timestamp": time.to_iso8601(self.trial_timestamp),
"distribution-version": self.cluster.distribution_version,
Expand Down
3 changes: 3 additions & 0 deletions esrally/resources/results-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"active": {
"type": "boolean"
},
"rally-version": {
"type": "keyword"
},
"environment": {
"type": "keyword"
},
Expand Down
3 changes: 3 additions & 0 deletions tests/metrics_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ def test_store_results(self):

expected_docs = [
{
"rally-version": "0.4.4",
"environment": "unittest",
"trial-timestamp": "20160131T000000Z",
"distribution-version": "5.0.0",
Expand All @@ -775,6 +776,7 @@ def test_store_results(self):
}
},
{
"rally-version": "0.4.4",
"environment": "unittest",
"trial-timestamp": "20160131T000000Z",
"distribution-version": "5.0.0",
Expand All @@ -799,6 +801,7 @@ def test_store_results(self):
}
},
{
"rally-version": "0.4.4",
"environment": "unittest",
"trial-timestamp": "20160131T000000Z",
"distribution-version": "5.0.0",
Expand Down

0 comments on commit 7bd62db

Please sign in to comment.