provider.rpc_counter_comparison
Documentation for eth_defi.provider.rpc_counter_comparison Python module.
Read-only comparison of complete UTC counter windows.
Legacy physical-attempt totals remain authoritative. Operation rows describe those same requests and must never be added to legacy totals.
Functions
|
Compare physical attempts per day for each chain/phase/method/provider. |
|
Aggregate an explicit half-open window from an immutable snapshot. |
- fetch_rpc_counter_window(path, start, end)
Aggregate an explicit half-open window from an immutable snapshot.
Item counts are deduplicated by chain, phase, date and cycle because each method/provider row repeats them. Old counters have no completion outcomes; their completed-cycle denominator is deliberately unavailable. Outcome counts deduplicate each status within a cycle; a retried cycle may appear under both failed and completed. They are not individual attempt counts. Windows filter stored UTC cycle-start dates, not individual request times; snapshot after the included cycles finish.
- Parameters
path (pathlib.Path) – Existing checkpointed DuckDB snapshot.
start (datetime.date) – Inclusive UTC date.
end (datetime.date) – Exclusive UTC date.
- Returns
Totals, daily rates and diagnostics.
groupscontains(chain_id, phase, api_call, rpc_provider_domain, call_count);phase_items_and_cyclescontains(chain_id, phase, items_scanned, cycle_count);operationscontains(chain_id, phase, operation, api_call, rpc_provider_domain, call_count); andoutcomescontains(chain_id, phase, outcome, cycle_count). Chain IDs and counts are integers; labels, methods and domains are strings.- Return type
- compare_rpc_counter_windows(before, after)
Compare physical attempts per day for each chain/phase/method/provider.
Different durations are normalised, but different chain coverage, cadence or incident periods still require operator interpretation.
- Parameters
before (dict) – Baseline returned by
fetch_rpc_counter_window().after (dict) – Follow-up returned by
fetch_rpc_counter_window().
- Returns
Rows with rates and percentage reduction, None for new groups.
- Return type