Skip to main content
Version: Next

StatisticsOptions

Configuration for the Statistics instance used by the crawler

Index

Properties

optionalconfig

Configuration instance to use

optionalid

id?: string

A unique identifier for this statistics instance. This ID is used for persistence to the key value store, ensuring the same statistics can be loaded after script restarts.

If not provided, an auto-incremented ID will be used for backward compatibility. This means statistics may not persist correctly across script restarts if crawler creation order changes.

optionalkeyValueStore

keyValueStore?: KeyValueStore

Key value store instance to persist the statistics. If not provided, the default one will be used when capturing starts

optionallog

log?: Log = Log

Parent logger instance, the statistics will create a child logger from this.

optionallogIntervalSecs

logIntervalSecs?: number = 60

Interval in seconds to log the current statistics

optionallogMessage

logMessage?: string = ‘Statistics’

Message to log with the current statistics

optionalpersistenceOptions

persistenceOptions?: PersistenceOptions

Control how and when to persist the statistics.

optionalsaveErrorSnapshots

saveErrorSnapshots?: boolean = false

Save HTML snapshot (and a screenshot if possible) when an error occurs.