From 78ce389900d4110609d6e2142ce17d1f597ba276 Mon Sep 17 00:00:00 2001 From: badra001 Date: Thu, 29 Jan 2026 15:06:39 -0500 Subject: [PATCH] fix --- .../tag-checker/analyze-tag-data.py | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/local-app/python-tools/cross-organization/tag-checker/analyze-tag-data.py b/local-app/python-tools/cross-organization/tag-checker/analyze-tag-data.py index 03ea852e..0f6bc4cc 100755 --- a/local-app/python-tools/cross-organization/tag-checker/analyze-tag-data.py +++ b/local-app/python-tools/cross-organization/tag-checker/analyze-tag-data.py @@ -128,4 +128,23 @@ def analyze(): print(f"Total Resources: {len(resource_tags)} | Fully Compliant: {len(resource_tags)-len(non_compliant)}") print(f"Compliance Rate: {((len(resource_tags)-len(non_compliant))/len(resource_tags)*100):.2f}%") - # --- SECTION 5: LEGACY M + # --- SECTION 5: LEGACY MAPPING --- + if legacy_map: + print(f"\n{div}\nSECTION 5: LEGACY MIGRATION STATUS\n{div}") + pending = 0 + for arn, tags in resource_tags.items(): + for leg, targ in legacy_map.items(): + if leg in tags and targ not in tags: pending += 1 + print(f"Pending Migration Tasks (Legacy Key exists, New Key missing): {pending}") + + # --- SECTION 6: SERVICE DISTRIBUTION --- + print(f"\n{div}\nSECTION 6: SERVICE DISTRIBUTION\n{div}") + print(f"{'Service Prefix':<20} | {'Friendly Name':<40} | {'Count'}") + for svc, count in sorted(svc_final_counts.items(), key=lambda x: x[1], reverse=True): + print(f"{svc:<20} | {service_map.get(svc, 'Unknown').ljust(40)} | {count}") + + mem_mb = round(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024, 2) + print(f"\n{div}\nPeak Memory Usage: {mem_mb} MB\n{div}") + +if __name__ == "__main__": + analyze()