Files

11 lines
527 B
Python

import json
d = json.load(open('/home/hmo/web-dashboard/static/mofin_health.json'))
print('generated:', d['generated_at'])
print('db_freshness:')
for f in d.get('db_freshness', []):
print(f" {f['label']}({f['table']}): last={f['last_record']} age={f['age_hours']}h warn={f['warn']}")
print()
warned = [j['name'] for j in d['json_files'] if j.get('warn')]
print(f'json_files warned: {len(warned)}')
migrated = [j['name'] for j in d['json_files'] if j.get('migrated_to_db')]
print(f'migrated (no longer warned): {migrated}')