Skip to content

Commit

Permalink
Remove all references to trial-timestamp
Browse files Browse the repository at this point in the history
With this commit we remove all leftover references to trial timestamp
and replace it with the new name race timestamp.

Relates elastic#128
Relates elastic#143
Relates elastic#144
  • Loading branch information
danielmitterdorfer authored Nov 20, 2019
1 parent e589317 commit 497df43
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ You can see the revisions `df07943` and `ff2164c`. If you want to see which comm

To add an annotation, use the admin tool. First find the correct trial timestamp by issuing `night-rally-admin list races --environment=nightly`. You will need the trial timestamp later. Below are examples for common cases:

* Add an annotation for all charts for a specific nightly benchmark trial: `night-rally-admin add annotation --environment=nightly --trial-timestamp=20170502T220213Z --message="Just a test annotation"`
* Add an annotation for all charts of one track for a specific nightly benchmark trial: `night-rally-admin add annotation --environment=nightly --trial-timestamp=20170502T220213Z --track=geonames --message="Just a test annotation for geonames"`
* Add an annotation for a specific chart of one track for a specific nightly benchmark trial: `night-rally-admin add annotation --environment=nightly --trial-timestamp=20170502T220213Z --track=geonames --chart=io --message="Just a test annotation"`
* Add an annotation for all charts for a specific nightly benchmark trial: `night-rally-admin add annotation --environment=nightly --race-timestamp=20170502T220213Z --message="Just a test annotation"`
* Add an annotation for all charts of one track for a specific nightly benchmark trial: `night-rally-admin add annotation --environment=nightly --race-timestamp=20170502T220213Z --track=geonames --message="Just a test annotation for geonames"`
* Add an annotation for a specific chart of one track for a specific nightly benchmark trial: `night-rally-admin add annotation --environment=nightly --race-timestamp=20170502T220213Z --track=geonames --chart=io --message="Just a test annotation"`

For more details, please issue `night-rally-admin add annotation --help`.

Expand Down
4 changes: 2 additions & 2 deletions external/benchmark-alert/watch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"bool": {
"filter": {
"range": {
"trial-timestamp": {
"race-timestamp": {
"gte": "now-1w"
}
}
Expand Down Expand Up @@ -47,7 +47,7 @@
"aggs": {
"series": {
"date_histogram": {
"field": "trial-timestamp",
"field": "race-timestamp",
"interval": "day"
},
"aggs": {
Expand Down
22 changes: 11 additions & 11 deletions night_rally/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def format_dict(d):

query["sort"] = [
{
"trial-timestamp": "desc"
"race-timestamp": "desc"
},
{
"track": "asc"
Expand All @@ -87,7 +87,7 @@ def format_dict(d):
else:
user_tags = ""

races.append([src["trial-timestamp"], src["track"], src["challenge"], src["car"],
races.append([src["race-timestamp"], src["track"], src["challenge"], src["car"],
src["cluster"]["distribution-version"], src["cluster"]["revision"], src["track-revision"], src["cluster"]["team-revision"], user_tags])
if races:
print(tabulate.tabulate(races, headers=["Race Timestamp", "Track", "Challenge", "Car", "Version", "Revision", "Track Revision", "Team Revision", "User Tags"]))
Expand Down Expand Up @@ -131,7 +131,7 @@ def list_annotations(es, args):
}
query["sort"] = [
{
"trial-timestamp": "desc"
"race-timestamp": "desc"
},
{
"track": "asc"
Expand All @@ -145,7 +145,7 @@ def list_annotations(es, args):
annotations = []
for hit in result["hits"]["hits"]:
src = hit["_source"]
annotations.append([hit["_id"], src["trial-timestamp"], src.get("track", ""), src.get("chart", ""), src["message"]])
annotations.append([hit["_id"], src["race-timestamp"], src.get("track", ""), src.get("chart", ""), src["message"]])
if annotations:
print(tabulate.tabulate(annotations, headers=["Annotation Id", "Timestamp", "Track", "Chart", "Message"]))
else:
Expand All @@ -154,23 +154,23 @@ def list_annotations(es, args):

def add_annotation(es, args):
environment = args.environment
trial_timestamp = args.trial_timestamp
race_timestamp = args.race_timestamp
track = args.track
chart = args.chart
message = args.message
dry_run = args.dry_run

if dry_run:
print("Would add annotation with message [%s] for environment=[%s], trial timestamp=[%s], track=[%s], chart=[%s]" %
(message, environment, trial_timestamp, track, chart))
print("Would add annotation with message [%s] for environment=[%s], race timestamp=[%s], track=[%s], chart=[%s]" %
(message, environment, race_timestamp, track, chart))
else:
if not es.indices.exists(index="rally-annotations"):
cwd = os.path.dirname(os.path.realpath(__file__))
body = open(os.path.join(cwd, "resources", "annotation-mapping.json"), "rt").read()
es.indices.create(index="rally-annotations", body=body)
es.index(index="rally-annotations", doc_type="_doc", body={
"environment": environment,
"trial-timestamp": trial_timestamp,
"race-timestamp": race_timestamp,
"track": track,
"chart": chart,
"message": message
Expand Down Expand Up @@ -251,7 +251,7 @@ def positive_number(v):
# if no "track" is given -> annotate all tracks
# "chart" indicates the graph. If no chart, is given, it is empty -> we need to write the queries to that we update all chart
#
# add [annotation] --environment=nightly --trial-timestamp --track --chart --text
# add [annotation] --environment=nightly --race-timestamp --track --chart --text
add_parser = subparsers.add_parser("add", help="Add records")
add_parser.add_argument(
"configuration",
Expand All @@ -270,8 +270,8 @@ def positive_number(v):
default="nightly"
)
add_parser.add_argument(
"--trial-timestamp",
help="Trial timestamp"
"--race-timestamp",
help="Race timestamp"
)
add_parser.add_argument(
"--track",
Expand Down
6 changes: 3 additions & 3 deletions night_rally/night_rally.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def copy_results_for_release_comparison(effective_start_date, configuration_name
"must": [
{
"term": {
"trial-timestamp": {
"race-timestamp": {
"value": ts
}
}
Expand Down Expand Up @@ -692,7 +692,7 @@ def copy_results_for_release_comparison(effective_start_date, configuration_name
index = None
doc_type = None
for hit in result["hits"]["hits"]:
# as we query for a specific trial timestamp, all documents are in the same index
# as we query for a specific race timestamp, all documents are in the same index
index = hit["_index"]
doc_type = hit["_type"]
src = hit["_source"]
Expand Down Expand Up @@ -739,7 +739,7 @@ def deactivate_outdated_results(effective_start_date, configuration_name, releas
],
"must_not": {
"term": {
"trial-timestamp": ts
"race-timestamp": ts
}
}
}
Expand Down

0 comments on commit 497df43

Please sign in to comment.