Skip to content
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

Include Grafana Cases into the Case Module #1453

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions e2e/tools/validator/src/validator/cases/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@

RAW_PROM_QUERIES = [
{
"expected_query": "rate(kepler_process_package_joules_total \
{{job='metal', pid='{vm_pid}', mode='dynamic'}}[{interval}])",
"expected_query": "rate(kepler_process_package_joules_total{{job='metal', pid='{vm_pid}', mode='dynamic'}}[{interval}])",
"actual_query": "rate(kepler_node_platform_joules_total{{job='vm'}}[{interval}])",
},
# {
# "expected_query": "",
# "actual_query": "",
# },
{
"expected_query": "rate(kepler_process_platform_joules_total{{job='metal', pid='{vm_pid}', mode='dynamic'}}[{interval}])",
"actual_query": "rate(kepler_node_platform_joules_total{{job='vm'}}[{interval}])",
},
{
"expected_query": "rate(kepler_process_bpf_cpu_time_ms_total{{job='metal', pid='{vm_pid}'}}[{interval}])",
"actual_query": "sum by(__name__, job) (rate(kepler_process_bpf_cpu_time_ms_total{{job='vm'}}[{interval}]))",
},
{
"expected_query": "rate(kepler_process_bpf_page_cache_hit_total{{job='metal', pid='{vm_pid}'}}[{interval}])",
"actual_query": "sum by(__name__, job) (rate(kepler_process_bpf_page_cache_hit_total{{job='vm'}}[{interval}]))",
},


]

Expand Down
9 changes: 5 additions & 4 deletions e2e/tools/validator/src/validator/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def stress(cfg: Validator, script_path: str):
test_cases = TestCases(cfg.metal.vm, cfg.prometheus)
metrics_validator = MetricsValidator(cfg.prometheus)
test_case_result = test_cases.load_test_cases()
click.secho("Validation results during stress test:")
for test_case in test_case_result.test_cases:
expected_query = test_case.expected_query
actual_query = test_case.actual_query
Expand All @@ -87,13 +88,13 @@ def stress(cfg: Validator, script_path: str):
expected_query,
actual_query)

# TODO: print what the values mean
click.secho("Validation results during stress test:")
click.secho(f"Expected Query Name: {expected_query}", fg='bright_yellow')
click.secho(f"Actual Query Name: {actual_query}", fg='bright_yellow')
click.secho(f"Absolute Errors during stress test: {metrics_res.ae}", fg='green')
click.secho(f"Absolute Percentage Errors during stress test: {metrics_res.ape}", fg='green')
click.secho(f"Mean Absolute Error (MAE) during stress test: {metrics_res.mae}", fg="blue")
click.secho(f"Mean Absolute Error (MAE) during stress test: {metrics_res.mae}", fg="red")
click.secho(f"Mean Absolute Percentage Error (MAPE) during stress test: {metrics_res.mape}", fg="red")
click.secho(f"Mean Squared Error (MSE) during stress test: {metrics_res.rmse}", fg="red")
click.secho(f"Mean Squared Error (MSE) during stress test: {metrics_res.rmse}", fg="blue")
click.secho("---------------------------------------------------", fg="cyan")


Loading