Skip to content

Commit 497df43

Browse files
Remove all references to trial-timestamp
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
1 parent e589317 commit 497df43

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ You can see the revisions `df07943` and `ff2164c`. If you want to see which comm
4949

5050
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:
5151

52-
* 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"`
53-
* 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"`
54-
* 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"`
52+
* 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"`
53+
* 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"`
54+
* 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"`
5555

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

external/benchmark-alert/watch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"bool": {
1515
"filter": {
1616
"range": {
17-
"trial-timestamp": {
17+
"race-timestamp": {
1818
"gte": "now-1w"
1919
}
2020
}
@@ -47,7 +47,7 @@
4747
"aggs": {
4848
"series": {
4949
"date_histogram": {
50-
"field": "trial-timestamp",
50+
"field": "race-timestamp",
5151
"interval": "day"
5252
},
5353
"aggs": {

night_rally/admin.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def format_dict(d):
6363

6464
query["sort"] = [
6565
{
66-
"trial-timestamp": "desc"
66+
"race-timestamp": "desc"
6767
},
6868
{
6969
"track": "asc"
@@ -87,7 +87,7 @@ def format_dict(d):
8787
else:
8888
user_tags = ""
8989

90-
races.append([src["trial-timestamp"], src["track"], src["challenge"], src["car"],
90+
races.append([src["race-timestamp"], src["track"], src["challenge"], src["car"],
9191
src["cluster"]["distribution-version"], src["cluster"]["revision"], src["track-revision"], src["cluster"]["team-revision"], user_tags])
9292
if races:
9393
print(tabulate.tabulate(races, headers=["Race Timestamp", "Track", "Challenge", "Car", "Version", "Revision", "Track Revision", "Team Revision", "User Tags"]))
@@ -131,7 +131,7 @@ def list_annotations(es, args):
131131
}
132132
query["sort"] = [
133133
{
134-
"trial-timestamp": "desc"
134+
"race-timestamp": "desc"
135135
},
136136
{
137137
"track": "asc"
@@ -145,7 +145,7 @@ def list_annotations(es, args):
145145
annotations = []
146146
for hit in result["hits"]["hits"]:
147147
src = hit["_source"]
148-
annotations.append([hit["_id"], src["trial-timestamp"], src.get("track", ""), src.get("chart", ""), src["message"]])
148+
annotations.append([hit["_id"], src["race-timestamp"], src.get("track", ""), src.get("chart", ""), src["message"]])
149149
if annotations:
150150
print(tabulate.tabulate(annotations, headers=["Annotation Id", "Timestamp", "Track", "Chart", "Message"]))
151151
else:
@@ -154,23 +154,23 @@ def list_annotations(es, args):
154154

155155
def add_annotation(es, args):
156156
environment = args.environment
157-
trial_timestamp = args.trial_timestamp
157+
race_timestamp = args.race_timestamp
158158
track = args.track
159159
chart = args.chart
160160
message = args.message
161161
dry_run = args.dry_run
162162

163163
if dry_run:
164-
print("Would add annotation with message [%s] for environment=[%s], trial timestamp=[%s], track=[%s], chart=[%s]" %
165-
(message, environment, trial_timestamp, track, chart))
164+
print("Would add annotation with message [%s] for environment=[%s], race timestamp=[%s], track=[%s], chart=[%s]" %
165+
(message, environment, race_timestamp, track, chart))
166166
else:
167167
if not es.indices.exists(index="rally-annotations"):
168168
cwd = os.path.dirname(os.path.realpath(__file__))
169169
body = open(os.path.join(cwd, "resources", "annotation-mapping.json"), "rt").read()
170170
es.indices.create(index="rally-annotations", body=body)
171171
es.index(index="rally-annotations", doc_type="_doc", body={
172172
"environment": environment,
173-
"trial-timestamp": trial_timestamp,
173+
"race-timestamp": race_timestamp,
174174
"track": track,
175175
"chart": chart,
176176
"message": message
@@ -251,7 +251,7 @@ def positive_number(v):
251251
# if no "track" is given -> annotate all tracks
252252
# "chart" indicates the graph. If no chart, is given, it is empty -> we need to write the queries to that we update all chart
253253
#
254-
# add [annotation] --environment=nightly --trial-timestamp --track --chart --text
254+
# add [annotation] --environment=nightly --race-timestamp --track --chart --text
255255
add_parser = subparsers.add_parser("add", help="Add records")
256256
add_parser.add_argument(
257257
"configuration",
@@ -270,8 +270,8 @@ def positive_number(v):
270270
default="nightly"
271271
)
272272
add_parser.add_argument(
273-
"--trial-timestamp",
274-
help="Trial timestamp"
273+
"--race-timestamp",
274+
help="Race timestamp"
275275
)
276276
add_parser.add_argument(
277277
"--track",

night_rally/night_rally.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def copy_results_for_release_comparison(effective_start_date, configuration_name
652652
"must": [
653653
{
654654
"term": {
655-
"trial-timestamp": {
655+
"race-timestamp": {
656656
"value": ts
657657
}
658658
}
@@ -692,7 +692,7 @@ def copy_results_for_release_comparison(effective_start_date, configuration_name
692692
index = None
693693
doc_type = None
694694
for hit in result["hits"]["hits"]:
695-
# as we query for a specific trial timestamp, all documents are in the same index
695+
# as we query for a specific race timestamp, all documents are in the same index
696696
index = hit["_index"]
697697
doc_type = hit["_type"]
698698
src = hit["_source"]
@@ -739,7 +739,7 @@ def deactivate_outdated_results(effective_start_date, configuration_name, releas
739739
],
740740
"must_not": {
741741
"term": {
742-
"trial-timestamp": ts
742+
"race-timestamp": ts
743743
}
744744
}
745745
}

0 commit comments

Comments
 (0)