Skip to content

Commit

Permalink
Merge pull request #666 from linsword13/update-meta
Browse files Browse the repository at this point in the history
A couple minor updates to the gcp-metadata modifier
  • Loading branch information
linsword13 authored Sep 27, 2024
2 parents 0fef98e + e7006db commit 5340f26
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions var/ramble/repos/builtin/modifiers/gcp-metadata/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,22 @@ def gcp_metadata_exec(self, executable_name, executable, app_inst=None):

return pre_cmds, post_cmds

def _process_id_list(self):
import os.path

def get_vm_id_list(self):
ids = set()
file_name = self.expander.expand_var(
"{experiment_run_dir}/gcp-metadata.id.log"
)

exp_run_dir = self.expander.expand_var_name("experiment_run_dir")
file_name = os.path.join(exp_run_dir, "gcp-metadata.id.log")
if os.path.isfile(file_name):
with open(file_name) as f:
for cur_id in f.readlines():
cur_id = cur_id.strip()
if cur_id.isnumeric():
ids.add(cur_id)
return sorted(ids)

def _process_id_list(self):
ids = self.get_vm_id_list()

if ids:
with open(
self.expander.expand_var(
"{experiment_run_dir}/gcp-metadata.id_list.log"
Expand Down Expand Up @@ -211,14 +212,6 @@ def _prepare_analysis(self, workspace):
units="",
)

figure_of_merit(
"Level 0 Groups",
fom_regex="Level 0 groups = (?P<num_groups>.*)",
log_file="{experiment_run_dir}/gcp-metadata.topology_summary.log",
group_name="num_groups",
units="",
)

figure_of_merit(
"All Hosts",
fom_regex="All hosts = (?P<hostlist>.*)",
Expand Down

0 comments on commit 5340f26

Please sign in to comment.