-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c045b39
commit f248688
Showing
2 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import sys | ||
|
||
from . import __main__ as main | ||
|
||
|
||
hdrs = [ | ||
"type", | ||
"name", | ||
"count", | ||
"meanRunningSeconds", | ||
"maximumRunningSeconds", | ||
"stdDevRunningSeconds", | ||
"maximumPeakCpuUtilization", | ||
"maximumPeakMemoryUtilization", | ||
"maxGpusReserved", | ||
"recommendedCpus", | ||
"recommendedMemoryGiB", | ||
"recommendOmicsInstanceType", | ||
"estimatedUSDForMaximumRunningSeconds", | ||
"estimatedUSDForMeanRunningSeconds", | ||
"storageMaximumGiB", | ||
"meanStorageMaximumGiB", | ||
"stdDevStorageMaximumGiB" | ||
] | ||
|
||
def aggregate_and_print(resources_list, pricing, headroom=0.0, out=sys.stdout): | ||
"""Aggregate resources and print to output""" | ||
for resources in resources_list: | ||
# filter resources to remove anything where res["type"] is not "run" | ||
resources = [r for r in resources if r["type"] == "run"] | ||
for res in resources: | ||
main.add_metrics(res, resources, pricing, headroom) | ||
|
||
# if there are scattter resources from the run with a common name prefix then aggregate | ||
names = [r["name"] for r in resources] | ||
names = list(set(names)) | ||
for name in names: | ||
_aggregate_resources(resources, name) |