ChemPal Documentation - v1.12.0
    Preparing search index...

    Module utils/SupplierStatsStore

    Functions - Utils

    incrementSearchQueryCount

    Increment search query count (called once per supplier at start of execute())

    incrementSuccess

    Increment successful HTTP connection count (HTTP 2xx, non-cached)

    incrementFailure

    Increment failed HTTP connection count (HTTP 4xx/5xx, network errors, non-cached)

    incrementProductCount

    Increment unique product count (called when a non-cached product detail is fetched)

    incrementParseError

    Increment parse/processing error count (called when product processing throws)

    getStats

    Read all stats from IndexedDB, returning the SupplierStatsData shape: { [dateKey]: { [supplier]: SupplierDayStats } }. Recording runs in every build; only the stats UI is gated (dev builds, or advanced mode).

    flushPendingStats

    Force any buffered increments to IndexedDB immediately, bypassing the debounce timer. Call this at points where the buffer would otherwise be at risk of never flushing — e.g. once a search finishes, since the popup can be closed (and its JS context destroyed) at any moment afterward.

    clearStats

    Clear all stats — removes all records from the supplierStats store.