-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
store aggregated results in separate folder #683
Conversation
d04f9f2
to
97a2a7a
Compare
osbenchmark/metrics.py
Outdated
doc = test_execution.as_dict() | ||
aggregated_execution_path = paths.aggregated_results_root(self.cfg, test_execution_id=test_execution.test_execution_id) | ||
io.ensure_dir(aggregated_execution_path) | ||
aggregated_file = os.path.join(aggregated_execution_path, "test_execution.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be better to call this aggregated_test_execution.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Michael Oviedo <[email protected]>
Signed-off-by: Michael Oviedo <[email protected]>
db9dcf3
to
20d6048
Compare
Signed-off-by: Michael Oviedo <[email protected]>
20d6048
to
447b7d6
Compare
Signed-off-by: Michael Oviedo <[email protected]>
5a2e279
to
f8b8c82
Compare
Signed-off-by: Michael Oviedo <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple suggestions
osbenchmark/metrics.py
Outdated
def format_dict(d): | ||
if d: | ||
items = sorted(d.items()) | ||
return ", ".join(["%s=%s" % (k, v) for k, v in items]) | ||
else: | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid repeating helper functions. This already exists in the list_test_executions()
function. It'd be better to move it out of both so that both can use it
osbenchmark/metrics.py
Outdated
aggregated_test_executions = [] | ||
for test_execution in test_execution_store(cfg).list_aggregations(): | ||
aggregated_test_executions.append([ | ||
test_execution.test_execution_id, | ||
time.to_iso8601(test_execution.test_execution_timestamp), | ||
test_execution.workload, | ||
format_dict(test_execution.workload_params), | ||
test_execution.test_procedure_name, | ||
test_execution.provision_config_instance_name, | ||
format_dict(test_execution.user_tags), | ||
test_execution.workload_revision, | ||
test_execution.provision_config_revision]) | ||
|
||
if len(aggregated_test_executions) > 0: | ||
console.println("\nRecent aggregated test executions:\n") | ||
console.println(tabulate.tabulate( | ||
aggregated_test_executions, | ||
headers=[ | ||
"TestExecution ID", | ||
"TestExecution Timestamp", | ||
"Workload", | ||
"Workload Parameters", | ||
"TestProcedure", | ||
"ProvisionConfigInstance", | ||
"User Tags", | ||
"workload Revision", | ||
"Provision Config Revision" | ||
])) | ||
else: | ||
console.println("") | ||
console.println("No recent aggregate tests found.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works but a lot of this is duplicated from list_test_executions()
. How do you feel about creating a separate helper method and just passing in the methods like the following pseudo code"
def list_test_executions(cfg):
list_test_helper(test_execution_store(cfg).list_aggregations(), "test executions")
def list_aggregated_test_results(cfg):
list_test_helper(test_execution_store(cfg).list_aggregations(), "aggregation tests")
def list_test_helper(test_store_method, test_execution_type):
def format_dict(d):
if d:
items = sorted(d.items())
return ", ".join(["%s=%s" % (k, v) for k, v in items])
else:
return None
test_executions = []
listed_test_executions = test_store_method
for test_execution in listed_test_executions:
...
console.println(f"No recent {test_execution_type} found.")
...
By putting boiler plate code in list_test_helper()
, we will avoid repeating code and slim down both list_test_executions(cfg)
and list_aggregated_test_results(cfg)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Did this
@@ -697,6 +698,8 @@ def dispatch_list(cfg): | |||
test_execution_orchestrator.list_pipelines() | |||
elif what == "test_executions": | |||
metrics.list_test_executions(cfg) | |||
elif what == "aggregated_results": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you've introduced a new method called list_aggregations()
, how do you feel about using aggregations
here as opposed to aggregated_results
? Aggregations would be more simple for users to type out. But on second thought, aggregations might be confused with OpenSearch aggregations. I'm open to either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I think aggregated_results
is more explicit and clear about what it's referring to. But we could make it so either aggregations
or aggregated_results
triggers the same function maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aggregated_results
is more explicit and we can go forth with that
192ec70
to
41c7f18
Compare
osbenchmark/metrics.py
Outdated
@@ -1275,7 +1275,7 @@ def results_store(cfg): | |||
return NoopResultsStore() | |||
|
|||
|
|||
def list_test_executions(cfg): | |||
def list_test_helper(store, title): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: store_item
might be more apt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done👍
41c7f18
to
8000774
Compare
Signed-off-by: Michael Oviedo <[email protected]>
8000774
to
7156d47
Compare
Description
Changes OSB's file storage so that aggregated test results are stored in their own folder,
aggregated_results
alongside thetest_executions
folder.Issues Resolved
#661
Testing
make it
+make test
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.