Skip to content

Commit f026125

Browse files
committed
Added initial implementation of plotGraph.py .
More charts should be added
1 parent 1e0ae37 commit f026125

6 files changed

Lines changed: 358 additions & 20 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ You have a sample directory obtained from measuring a workflow execution using W
8484

8585
The command line is something like:
8686

87+
```bash
88+
python execution-metrics-collector.py {base_metrics_directory} {command line} {and} {parameters}
89+
```
90+
91+
The equivalent old wrapper version would be:
92+
8793
```bash
8894
./execution-metrics-collector.sh {base_metrics_directory} {command line} {and} {parameters}
8995
```
@@ -100,6 +106,15 @@ For instance, the sample directory was obtained just running next command line:
100106
~/projects/execution-process-metrics-collector/execution-metrics-collector.sh ~/projects/execution-process-metrics-collector/Wetlab2Variations_metrics python WfExS-backend.py -L workflow_examples/local_config.yaml staged-workdir offline-exec 01a1db90-1508-4bad-beb7-7f7989838542
101107
```
102108

109+
## Time series charts
110+
The program `plotGraph.py` is a replacement for the original `plotGraph.sh`. It generates
111+
several line charts for each monitored process, comparing the time series of
112+
interesting metrics.
113+
114+
```bash
115+
python plotGraph.py sample-series/Wetlab2Variations_metrics/2025_05_20-02_19-14001/ dest_directory
116+
```
117+
103118
## Digestion
104119

105120
The program `tdp-finder.py` helps to obtain the TDP of an Intel processor, using the gathered metadata stored at `cpu_details.json` within the series directory.

execution_process_metrics_collector/aggregator.py

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
from .parser import (
4848
metrics_parser,
49+
timedelta_noday_formatter,
4950
)
5051

5152
logger = logging.getLogger(__name__)
@@ -128,6 +129,8 @@ def draw_tree(
128129
matplotlib.use("agg")
129130
fig.savefig(outputs_dir / "graph.png")
130131

132+
plt.close(fig)
133+
131134

132135
def draw_spiral(
133136
pids: "pd.DataFrame",
@@ -195,26 +198,7 @@ def draw_spiral(
195198
matplotlib.use("agg")
196199
fig.savefig(outputs_dir / "spiral-graph.png")
197200

198-
199-
def timedelta_full_formatter(td: "pd.Timedelta") -> "str":
200-
return str(td)
201-
202-
203-
def timedelta_noday_formatter(td: "pd.Timedelta") -> "str":
204-
if td.components.days > 0:
205-
return timedelta_full_formatter(td)
206-
207-
if td.components.milliseconds > 0:
208-
return "{0:02d}:{1:02d}:{2:02d}.{3:03d}".format(
209-
td.components.hours,
210-
td.components.minutes,
211-
td.components.seconds,
212-
td.components.milliseconds,
213-
)
214-
else:
215-
return "{0:02d}:{1:02d}:{2:02d}".format(
216-
td.components.hours, td.components.minutes, td.components.seconds
217-
)
201+
plt.close(fig)
218202

219203

220204
def draw_consumptions_chart(
@@ -322,6 +306,8 @@ def draw_consumptions_chart(
322306
matplotlib.use("agg")
323307
fig.savefig(outputs_dir / "consumptions.png")
324308

309+
plt.close(fig)
310+
325311

326312
def draw_lollipop_chart(
327313
node_consumptions: "pd.DataFrame",
@@ -460,6 +446,8 @@ def draw_lollipop_chart(
460446
matplotlib.use("agg")
461447
fig.savefig(outputs_dir / "timeline.png")
462448

449+
plt.close(fig)
450+
463451

464452
def metrics_aggregator(
465453
series_dir: "pathlib.Path",

execution_process_metrics_collector/parser.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,24 @@ def metrics_parser(
181181
pids["subtree_root"] = subtree_root
182182

183183
return pids, num_cpu_cores, sampling_period_seconds
184+
185+
186+
def timedelta_full_formatter(td: "pd.Timedelta") -> "str":
187+
return str(td)
188+
189+
190+
def timedelta_noday_formatter(td: "pd.Timedelta") -> "str":
191+
if td.components.days > 0:
192+
return timedelta_full_formatter(td)
193+
194+
if td.components.milliseconds > 0:
195+
return "{0:02d}:{1:02d}:{2:02d}.{3:03d}".format(
196+
td.components.hours,
197+
td.components.minutes,
198+
td.components.seconds,
199+
td.components.milliseconds,
200+
)
201+
else:
202+
return "{0:02d}:{1:02d}:{2:02d}".format(
203+
td.components.hours, td.components.minutes, td.components.seconds
204+
)

0 commit comments

Comments
 (0)