# Path: irisett/stats.py
# def get_section(section: Optional[str]) -> Dict[str, float]:
# def set(var: str, value: float, section: Optional[str] = None) -> None:
# def inc(var: str, section: Optional[str] = None) -> None:
# def dec(var: str, section: Optional[str] = None) -> None:
# def get_stats() -> Dict[str, float]:
# 
# Path: irisett/log.py
# def configure_logging(logtype: str, logfilename: Optional[str]=None, debug_logging: bool=False,
#                       rotate_length: int=1000000, max_rotated_files: int=250) -> None:
# def msg(logmsg: str, section: Optional[str]=None) -> None:
# def debug(logmsg: str, section: Optional[str]=None) -> None:
#     def log_msg(self, logmsg: str) -> None:
#     def log_debug(self, logmsg: str) -> None:
# class LoggingMixin:


from typing import Callable, Dict, Optional, List, Set, Union, Any
from irisett import (
    stats,
    log,
)
import time
import asyncio
        ret = True
        if self.event_filter and event_name not in self.event_filter:
            ret = False
        elif self.active_monitor_filter and 'monitor' in args and args['monitor'].monitor_type == 'active' \
                and args['monitor'].id not in self.active_monitor_filter:
            ret = False
        return ret


class EventTracer:
    """The main event tracer class.

    Creates listeners and receives events. When an event is received it
    is sent to all listeners (that matches the events filters.
    """
    def __init__(self) -> None:
        self.listeners = set()  # type: Set[EventListener]
        stats.set('num_listeners', 0, 'EVENT')
        stats.set('events_fired', 0, 'EVENT')
        self.loop = asyncio.get_event_loop()

    def listen(self, callback: Callable, *,
               event_filter: Optional[List[str]] = None,
               active_monitor_filter: Optional[List[Union[str, int]]] = None) -> EventListener:
        """Set a callback function that will receive events.

        Two filters can be used when selecting which events the callback will
        receive. event_filter can be a list of event names that must match.
        active_monitor_filter can be a list of active monitor ids that must match.
        """

# Path: irisett/stats.py
# def get_section(section: Optional[str]) -> Dict[str, float]:
# def set(var: str, value: float, section: Optional[str] = None) -> None:
# def inc(var: str, section: Optional[str] = None) -> None:
# def dec(var: str, section: Optional[str] = None) -> None:
# def get_stats() -> Dict[str, float]:
# 
# Path: irisett/log.py
# def configure_logging(logtype: str, logfilename: Optional[str]=None, debug_logging: bool=False,
#                       rotate_length: int=1000000, max_rotated_files: int=250) -> None:
# def msg(logmsg: str, section: Optional[str]=None) -> None:
# def debug(logmsg: str, section: Optional[str]=None) -> None:
#     def log_msg(self, logmsg: str) -> None:
#     def log_debug(self, logmsg: str) -> None:
# class LoggingMixin:


# Path: irisett/event.py
from typing import Callable, Dict, Optional, List, Set, Union, Any
from irisett import (
    stats,
    log,
)
import time
import asyncio

        ret = True
        if self.event_filter and event_name not in self.event_filter:
            ret = False
        elif self.active_monitor_filter and 'monitor' in args and args['monitor'].monitor_type == 'active' \
                and args['monitor'].id not in self.active_monitor_filter:
            ret = False
        return ret


class EventTracer:
    """The main event tracer class.

    Creates listeners and receives events. When an event is received it
    is sent to all listeners (that matches the events filters.
    """
    def __init__(self) -> None:
        self.listeners = set()  # type: Set[EventListener]
        stats.set('num_listeners', 0, 'EVENT')
        stats.set('events_fired', 0, 'EVENT')
        self.loop = asyncio.get_event_loop()

    def listen(self, callback: Callable, *,
               event_filter: Optional[List[str]] = None,
               active_monitor_filter: Optional[List[Union[str, int]]] = None) -> EventListener:
        """Set a callback function that will receive events.

        Two filters can be used when selecting which events the callback will
        receive. event_filter can be a list of event names that must match.
        active_monitor_filter can be a list of active monitor ids that must match.
        """

        stats.inc('num_listeners', 'EVENT')