This commit is contained in:
Daimakaimura
2023-05-19 11:20:24 +01:00
parent 6ccc9fd609
commit 5451b29a79

View File

@@ -289,13 +289,7 @@ def gather_probes(containers_data, probes_ids, num_threads=16):
return all_containers_metrics
def save_metrics_to_disk(metrics, filename):
# Get the parent directory of the file
parent_directory = os.path.dirname(filename)
# Create the parent directory if it does not exist
if not os.path.exists(parent_directory):
os.makedirs(parent_directory)
# Save the metrics to the file
with open(filename, 'w') as f:
json.dump(metrics, f, indent=4)