Collector
Collector will convert data_t to Tracking
and store them in a somewhere.
- class duetector.collectors.base.Collector(config: dict[str, Any] | None = None, *args, **kwargs)[source]
Base class for all collectors, provide a ThreadPoolExecutor each instance for async emit.
By default, the config scope of
Collectoriscollector.{class_name}.Implementations should override
_emitandsummarymethod, seeDequeCollectoras an example.- _backend_imp
Default backend implementation for
Collectoralias of
ThreadPoolExecutor
- property backend_args
Arguments for backend
self._backend_imp
- property config_scope
Config scope for current collector
- default_config = {'backend_args': {'max_workers': 10}, 'disabled': False, 'statis_id': ''}
Default config for
Collector
- property disabled
If current collector is disabled
- property id: str
ID for current collector, used to identify current collector in database
If not set, use hostname
- class duetector.collectors.base.DequeCollector(config: dict[str, Any] | None = None, *args, **kwargs)[source]
Bases:
CollectorA simple collector using deque, disabled by default
- Config:
maxlen: Max length of deque
- default_config = {'backend_args': {'max_workers': 10}, 'disabled': True, 'maxlen': 1024, 'statis_id': ''}
Default config for
DequeCollector
- property maxlen
Max length of deque