ScanResult

Documentation for eth_defi.currency_api.scanner.ScanResult Python class.

class ScanResult

Bases: object

Outcome of an incremental scan.

Variables
  • db – The (still open) database. The caller is responsible for closing it.

  • dates_requested – Number of distinct dates fetched over HTTP this run.

  • rows_upserted – Number of (date, quote) rate rows written.

  • quotes_recorded – Individually missing quotes recorded as permanently unavailable.

  • quotes_pending – Individually missing quotes left pending (within grace, retried later).

  • dates_unavailable – Whole dates recorded as permanently unavailable (404 on both hosts).

  • dates_pending – Whole dates that 404’d but are within grace (retried later).

  • transient_failures – Dates that failed transiently this run and will be retried; the run should exit non-zero.

  • dates_given_up – Dates that exceeded max_transient_attempts consecutive transient failures and were recorded as permanent persistent_error gaps.

Attributes summary

db

The still-open database.

dates_requested

Distinct dates fetched over HTTP.

rows_upserted

Rate rows written.

quotes_recorded

Missing quotes recorded as permanently unavailable.

quotes_pending

Missing quotes left pending within grace.

dates_unavailable

Whole dates recorded as unavailable.

dates_pending

Whole dates pending within grace.

transient_failures

Transient failures requiring retry / non-zero exit.

dates_given_up

Dates given up on after exceeding the transient-attempt budget.

Methods summary

__init__(db[, dates_requested, ...])

db: eth_defi.currency_api.database.CurrencyRateDatabase

The still-open database.

dates_requested: int

Distinct dates fetched over HTTP.

rows_upserted: int

Rate rows written.

quotes_recorded: int

Missing quotes recorded as permanently unavailable.

quotes_pending: int

Missing quotes left pending within grace.

dates_unavailable: int

Whole dates recorded as unavailable.

dates_pending: int

Whole dates pending within grace.

transient_failures: int

Transient failures requiring retry / non-zero exit.

dates_given_up: int

Dates given up on after exceeding the transient-attempt budget.

__init__(db, dates_requested=0, rows_upserted=0, quotes_recorded=0, quotes_pending=0, dates_unavailable=0, dates_pending=0, transient_failures=0, dates_given_up=0)
Parameters
Return type

None