mirror of
https://github.com/nikdoof/globaltalk-scraper.git
synced 2025-12-18 13:29:23 +00:00
Update metrics script
This commit is contained in:
@@ -19,8 +19,13 @@ def main():
|
|||||||
globaltalk_data = json.load(file)
|
globaltalk_data = json.load(file)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print(f"Error: File '{args.filename}' not found.")
|
print(f"Error: File '{args.filename}' not found.")
|
||||||
|
sys.exit(1)
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
print(f"Error: Failed to decode JSON - {e}")
|
print(f"Error: Failed to decode JSON - {e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Number of zones
|
||||||
|
args.output.write('globaltalk_zones {0}\n'.format(len(globaltalk_data['zones'])))
|
||||||
|
|
||||||
# Nodes per zone
|
# Nodes per zone
|
||||||
zone_counts = collections.Counter(node.get("zone", "Unknown") for node in globaltalk_data['nodes'])
|
zone_counts = collections.Counter(node.get("zone", "Unknown") for node in globaltalk_data['nodes'])
|
||||||
|
|||||||
Reference in New Issue
Block a user