Skip to content

Add ability to delete race from metric store#1620

Merged
ebadyano merged 13 commits intoelastic:masterfrom
ebadyano:delete-race
Nov 23, 2022
Merged

Add ability to delete race from metric store#1620
ebadyano merged 13 commits intoelastic:masterfrom
ebadyano:delete-race

Conversation

@ebadyano
Copy link
Copy Markdown
Contributor

@ebadyano ebadyano commented Nov 15, 2022

Added the following helper admin function:

  • delete a race from metric store. Use esrally delete race --id=..

Relates to #1597

# Conflicts:
#	esrally/metrics.py
# Conflicts:
#	esrally/metrics.py
@ebadyano ebadyano added the enhancement Improves the status quo label Nov 15, 2022
@ebadyano ebadyano self-assigned this Nov 15, 2022
# Conflicts:
#	esrally/metrics.py
# Conflicts:
#	esrally/metrics.py
@ebadyano ebadyano changed the title Add additional admin functions: delete race, list/delete annotations Add delete race helper Nov 15, 2022
@ebadyano ebadyano changed the title Add delete race helper Add ability to delete race from metric store Nov 15, 2022
@ebadyano ebadyano marked this pull request as ready for review November 15, 2022 20:31
@DJRickyB
Copy link
Copy Markdown
Contributor

@elasticmachine run rally/rally-tracks-compat

Copy link
Copy Markdown
Contributor

@DJRickyB DJRickyB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, with one thought in comments

self.race_store.delete_race()
expected_query = {"query": {"bool": {"filter": [{"term": {"environment": "unittest-env"}}, {"term": {"race-id": "0101"}}]}}}
self.es_mock.delete_by_query.assert_called_with(index="rally-results-*", body=expected_query)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the print(f"Did not find [{race_id}] in environment [{environment}].") error important enough to assert happened here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, but can we please switch to console.println instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added test, and changed to console. thank you

@ebadyano ebadyano merged commit 94bad8b into elastic:master Nov 23, 2022
@pquentin
Copy link
Copy Markdown
Member

Why did we add _chart_type and _chart_name in this pull request? At a cursory glance they seem unused

@ebadyano
Copy link
Copy Markdown
Contributor Author

Why did we add _chart_type and _chart_name in this pull request? At a cursory glance they seem unused

@pquentin I think that's from me not properly separating add annotations changes from this pull request. some leftovers after i split them up.

@pquentin
Copy link
Copy Markdown
Member

@ebadyano Thanks. However today in rally master they still seem unused.

@pquentin pquentin added this to the 2.7.1 milestone Mar 2, 2023
@pquentin pquentin added the :internal Changes for internal, undocumented features: e.g. experimental, release scripts label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improves the status quo :internal Changes for internal, undocumented features: e.g. experimental, release scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants