Wait for docker containers to exist before starting recording.
This enables us to capture the full life of the container since the script can now be kicked off before the container is launched.
This commit is contained in:
parent
927c14d238
commit
561bfa40ab
@ -30,6 +30,12 @@ def main():
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
samples: list[Sample] = []
|
||||
labels: dict[ContainerId, ContainerName] = {}
|
||||
# First wait for any docker container to exist.
|
||||
while True:
|
||||
sample, labels_in_sample = take_sample()
|
||||
if labels_in_sample:
|
||||
break
|
||||
# And then record memory until no containers exist.
|
||||
while True:
|
||||
sample, labels_in_sample = take_sample()
|
||||
if not labels_in_sample:
|
||||
|
Loading…
Reference in New Issue
Block a user