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_rpc_counter_windows(before, after)

Compare physical attempts per day for each chain/phase/method/provider.

fetch_rpc_counter_window(path, start, end)

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
Returns

Totals, daily rates and diagnostics. groups contains (chain_id, phase, api_call, rpc_provider_domain, call_count); phase_items_and_cycles contains (chain_id, phase, items_scanned, cycle_count); operations contains (chain_id, phase, operation, api_call, rpc_provider_domain, call_count); and outcomes contains (chain_id, phase, outcome, cycle_count). Chain IDs and counts are integers; labels, methods and domains are strings.

Return type

dict

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
Returns

Rows with rates and percentage reduction, None for new groups.

Return type

list[dict]