Function
run
(service: str, backend: list[str], suffix: str = "")
Source from the content-addressed store, hash-verified
| 38 | threads = [] |
| 39 | |
| 40 | def run(service: str, backend: list[str], suffix: str = ""): |
| 41 | heap_profile = subprocess.run( |
| 42 | mzcompose + ["exec", service, "curl", "--silent"] + backend, |
| 43 | text=False, |
| 44 | capture_output=True, |
| 45 | ).stdout |
| 46 | |
| 47 | if not heap_profile: |
| 48 | return |
| 49 | |
| 50 | filename = f"prof-{service}{suffix}-{time_str}.pb.gz" |
| 51 | with open(filename, "wb") as f: |
| 52 | f.write(heap_profile) |
| 53 | if args.upload: |
| 54 | subprocess.run( |
| 55 | [ |
| 56 | "buildkite-agent", |
| 57 | "artifact", |
| 58 | "upload", |
| 59 | "--log-level", |
| 60 | "error", |
| 61 | filename, |
| 62 | ], |
| 63 | capture_output=True, |
| 64 | ) |
| 65 | |
| 66 | services = json.loads( |
| 67 | subprocess.run( |
Callers
nothing calls this directly
Tested by
no test coverage detected