File: factory.py

package info (click to toggle)
python-snitun 0.45.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 664 kB
  • sloc: python: 6,681; sh: 5; makefile: 3
file content (19 lines) | stat: -rw-r--r-- 497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Factory functions for creating metrics collectors."""

from collections.abc import Callable

from .base import MetricsCollector
from .noop import NoOpMetricsCollector

# Type alias for metrics factory function
MetricsFactory = Callable[[], MetricsCollector]


def create_noop_metrics_collector() -> MetricsCollector:
    """
    Create a no-op metrics collector for zero overhead.

    Returns:
        NoOpMetricsCollector instance that does nothing.
    """
    return NoOpMetricsCollector()