Skip to content

Commit 64cc5eb

Browse files
committed
Added execution-metrics-collector.py as a future replacement for execution-metrics-collector.sh
1 parent 3e612a4 commit 64cc5eb

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

execution-metrics-collector.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
# execution-process-metrics-collector, a process tree metrics gatherer.
6+
# Copyright (C) 2025 Barcelona Supercomputing Center, José M. Fernández
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful, but
14+
# WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
# General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
from execution_process_metrics_collector.collector import main__commandline
22+
23+
if __name__ == "__main__":
24+
main__commandline()

execution_process_metrics_collector/collector.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,3 +688,19 @@ def main() -> "None":
688688
file=sys.stderr,
689689
)
690690
sys.exit(1)
691+
692+
693+
def main__commandline() -> "None":
694+
if len(sys.argv) >= 3:
695+
execution_metrics_collector(
696+
sys.argv[2:],
697+
pathlib.Path(sys.argv[1]),
698+
sleep_secs=1,
699+
match_docker=True,
700+
)
701+
else:
702+
print(
703+
f"Usage: {sys.argv[0]} {{results_dir}} <command line to be run>",
704+
file=sys.stderr,
705+
)
706+
sys.exit(1)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
]
7070
},
7171
scripts=[
72+
"execution-metrics-collector.py",
7273
"process-metrics-collector.py",
7374
"metrics-aggregator.py",
7475
"tdp-finder.py",

0 commit comments

Comments
 (0)