Skip to content

Commit

Permalink
Add level name to annotate the level number
Browse files Browse the repository at this point in the history
The names come from the physical_host documentation:
https://cloud.google.com/compute/docs/instances/use-compact-placement-policies#verify-vm-location.

Tested output:

```
modifier::GcpMetadata::Level 0 Groups (cluster) = 1
modifier::GcpMetadata::Level 1 Groups (rack) = 1
modifier::GcpMetadata::Level 2 Groups (host) = 2
```
  • Loading branch information
linsword13 committed Oct 7, 2024
1 parent 4a5d93e commit b9eaae8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions var/ramble/repos/builtin/modifiers/gcp-metadata/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ def _process_physical_hosts(self, workspace):
"w+",
) as f:
if len(level0_groups) > 0:
f.write(f"Level 0 groups = {len(level0_groups)}\n")
f.write(f"Level 1 groups = {len(level1_groups)}\n")
f.write(f"Level 2 groups = {len(level2_groups)}\n")
# The group level name comes from https://cloud.google.com/compute/docs/instances/use-compact-placement-policies#verify-vm-location.
f.write(f"Level 0 groups (cluster) = {len(level0_groups)}\n")
f.write(f"Level 1 groups (rack) = {len(level1_groups)}\n")
f.write(f"Level 2 groups (host) = {len(level2_groups)}\n")
f.write(f'All hosts = {",".join(all_hosts)}\n')

def _prepare_analysis(self, workspace):
Expand Down Expand Up @@ -205,8 +206,8 @@ def _prepare_analysis(self, workspace):
)

figure_of_merit(
"Level {level_num} Groups",
fom_regex="Level (?P<level_num>[0-9]) groups = (?P<num_groups>[0-9]+)",
"Level {level_num} Groups ({level_name})",
fom_regex=r"Level (?P<level_num>[0-9]) groups \((?P<level_name>[\w]+)\) = (?P<num_groups>[0-9]+)",
log_file="{experiment_run_dir}/gcp-metadata.topology_summary.log",
group_name="num_groups",
units="",
Expand Down

0 comments on commit b9eaae8

Please sign in to comment.