sustainable-computing-io / kepler

Kepler (Kubernetes-based Efficient Power Level Exporter) uses eBPF to probe performance counters and other system stats, use ML models to estimate workload energy consumption based on these stats, and exports them as Prometheus metrics
https://sustainable-computing.io
Apache License 2.0
1.19k stars 184 forks source link

chore(validator): MAPE and json generation #1824

Closed sthaha closed 1 month ago

sthaha commented 1 month ago

This commit fixes MAPE calculation and its tests. Additionally, the json generation is cleaned and added to gen-report as well.

github-actions[bot] commented 1 month ago

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: The chore(validator): MAPE and json generation pull request refactors the validator tool, focusing on MAPE calculation, JSON generation, and report creation.

Key Modifications:

  1. MAPE calculation: The mape function now returns the MAPE value multiplied by 100, which may affect applications using this function.
  2. JSON generation: The create_json function and its helpers are removed, replaced by write_json_report and asdict for JSON generation.
  3. Report creation: The JsonTemplate class is updated, removing file_path, machine_spec, and result parameters, and adding machine_specs and results instead.
  4. Custom object handling: The CustomEncoder class is improved to better handle custom objects and datetime objects.

Impact on Codebase:

Suggestions for Improvement: