From b2a9c44c9e8b3d91f5bef68590d15db51564716f Mon Sep 17 00:00:00 2001 From: datechnoman Date: Wed, 27 Dec 2023 08:58:44 +0000 Subject: [PATCH] Added in a cdx filesize count statistic for the Grafana Dashboard to report on sizing --- mediafire_cdxprocessor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mediafire_cdxprocessor.py b/mediafire_cdxprocessor.py index 1ba0a6b..000f126 100644 --- a/mediafire_cdxprocessor.py +++ b/mediafire_cdxprocessor.py @@ -22,6 +22,10 @@ def run_cdxsummary(file_path, json_filepath): # Add "cdxcount" entry with value 1 json_output["cdxcount"] = 1 + # Add "cdxsize" entry with the size of the cdx.gz file in bytes + cdx_size_bytes = os.path.getsize(file_path) + json_output["cdxsize"] = cdx_size_bytes + # Remove "pathquery" and "samples" keys if "pathquery" in json_output: del json_output["pathquery"]