diff --git a/monitoring/db/scripts/get_detailed_power.py b/monitoring/db/scripts/get_detailed_power.py index b316f4b..5218d9b 100755 --- a/monitoring/db/scripts/get_detailed_power.py +++ b/monitoring/db/scripts/get_detailed_power.py @@ -17,6 +17,8 @@ def parse_arguments(args): help="Job did run on Hawk-AI") parser.add_argument('--report-nodes', action='store_true', help='Report power of all nodes, not just statisitcs across nodes.') + parser.add_argument('--energy-only', action='store_true', + help='Return only total consumed energy, not detailed power') parser.add_argument('jobid', type=parse_jobid, nargs='+', help='Job ID such as "2260215" or "2260215.hawk-pbs5"') @@ -259,6 +261,13 @@ class App: print('No data found for job ID "{}"'.format(jobid)) continue + if self.config.energy_only: + if power.energy: + print(power.energy) + else: + print('No total energy for job ID "{}"'.format(jobid)) + continue + fn = power.to_file(jobid, header) if fn: print('Created file {fn}'.format(fn=fn))