mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-10 15:42:10 +03:00
New metrics.py: collect_metrics() does the per-section extraction a flat dict walk can't (latency needs label/host/method, TLS label/host, path hops target/ttl/ip/asn), producing a flat Metric list that render_prometheus() and render_csv() each format in about 15 lines. Simpler than treating them as two separate renderers. FORMAT_EXTENSIONS gained "prom"/"csv" as the single wiring point both parse_formats() and Output._normalize_formats() already key off of. New history.py finds a previous JSON report for the same ASN by reusing the exact filename convention exporter.report_filename() already writes, so the lookup key can't drift from what's on disk. Wired into diagnose() before write_report() - a compact vs-previous-run summary (compare.py::render_diff_brief(), new) prints automatically whenever this run writes JSON and an earlier one exists for the same network; silent on every other case (first run, prior run wrote no JSON prints one note instead of guessing). New --no-auto-diff escapes it per run, history.auto_diff in config disables it entirely. New trend.py aggregates N saved JSON reports into per-label sparkline series via --trend N - read-only, and it doesn't touch the network to find "this network's" history either: history.latest_key() just reads it off the newest report filename already on disk. Growing FORMAT_EXTENSIONS to 5 entries broke three pre-existing tests that hardcoded the old 3-format set; fixed in this commit. Live-tested: prom/csv artifacts render correctly, auto-diff fired on a second run, --trend 3 produced readable output, --compare unaffected. Part of plans/zesty-zooming-wilkinson.md (gitignored). |
||
|---|---|---|
| .. | ||
| fixtures | ||
| conftest.py | ||
| test_bgp.py | ||
| test_bgp_path.py | ||
| test_captive_portal.py | ||
| test_cgnat_nat64.py | ||
| test_cli_formats.py | ||
| test_compare.py | ||
| test_config.py | ||
| test_dns_advanced.py | ||
| test_dns_leak.py | ||
| test_dnsbl_decode.py | ||
| test_dpi_check.py | ||
| test_exporter.py | ||
| test_exporter_l7.py | ||
| test_history.py | ||
| test_hop_asn.py | ||
| test_icmp_win_parse.py | ||
| test_icmp_win_trace.py | ||
| test_iface.py | ||
| test_interpret.py | ||
| test_interpret_l7.py | ||
| test_ip_geo_normalize.py | ||
| test_metrics.py | ||
| test_models.py | ||
| test_netinfo.py | ||
| test_orchestration.py | ||
| test_prefix_benchmark.py | ||
| test_prober_stats.py | ||
| test_reputation.py | ||
| test_speed_cloudflare.py | ||
| test_speed_fastcom.py | ||
| test_speed_math.py | ||
| test_stats.py | ||
| test_tls_rtt.py | ||
| test_traceparse.py | ||
| test_traceroute_cascade.py | ||
| test_trend.py | ||
| test_watch.py | ||