Skip to content

Commit

Permalink
hwgraph: Adding PDU support
Browse files Browse the repository at this point in the history
This commit is about graphing PDU metrics.

The commit is very light since it only requires adding PDU as a new
source of power metrics and plot some specific graphs.

The code is very light at PDUs are just an additional source of data in
the existing data set.

Signed-off-by: Erwan Velu <[email protected]>
  • Loading branch information
ErwanAliasr1 committed Jul 9, 2024
1 parent c0057bf commit 34b1994
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion graph/hwgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def compare_traces(args) -> None:
def graph_monitoring_metrics(args, trace: Trace, bench_name: str, output_dir) -> int:
rendered_graphs = 0
bench = trace.bench(bench_name)
for metric_name in ["BMC", "CPU"]:
for metric_name in ["BMC", "CPU", "PDU"]:
metrics = bench.get_component(Metrics.MONITOR, metric_name)
if metrics:
for metric in metrics:
Expand Down Expand Up @@ -148,6 +148,28 @@ def graph_cpu(args, trace: Trace, bench_name: str, output_dir) -> int:
return rendered_graphs


def graph_pdu(args, trace: Trace, bench_name: str, output_dir) -> int:
rendered_graphs = 0
bench = trace.bench(bench_name)
pdu_graphs = {}
pdu_graphs["PDU power reporting"] = {Metrics.POWER_CONSUMPTION: "PDU"}
for graph_name in pdu_graphs:
# Let's render the performance, perf_per_temp, perf_per_watt graphs
for metric, filter in pdu_graphs[graph_name].items():
for second_axis in [None, Metrics.THERMAL, Metrics.POWER_CONSUMPTION]:
rendered_graphs += generic_graph(
args,
output_dir,
bench,
metric,
graph_name,
second_axis,
filter=filter,
)

return rendered_graphs


def graph_thermal(args, trace: Trace, bench_name: str, output_dir) -> int:
rendered_graphs = 0
rendered_graphs += generic_graph(
Expand Down Expand Up @@ -219,6 +241,7 @@ def valid_traces(args):
)
rendered_graphs += graph_fans(args, trace, bench_name, output_dir)
rendered_graphs += graph_cpu(args, trace, bench_name, output_dir)
rendered_graphs += graph_pdu(args, trace, bench_name, output_dir)
rendered_graphs += graph_thermal(args, trace, bench_name, output_dir)

return rendered_graphs
Expand Down

0 comments on commit 34b1994

Please sign in to comment.