Skip to content
Snippets Groups Projects
Commit 0a9a9189 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

__all__s added

parent c8f2a24e
No related branches found
No related tags found
No related merge requests found
......@@ -108,7 +108,7 @@ to create an independent "sub-metric" of sorts, eg.
This functionality is provided by the below class:
.. autoclass:: satella.instrumentation.metrics.metric_types.base.EmbeddedSubmetrics
.. autoclass:: satella.instrumentation.metrics.metric_types.EmbeddedSubmetrics
:members:
Rolling your own metrics
......
......@@ -4,8 +4,7 @@ import threading
import typing as tp
logger = logging.getLogger(__name__)
from .metric_types.base import RUNTIME, DISABLED, DEBUG, INHERIT, Metric
from .metric_types.registry import METRIC_NAMES_TO_CLASSES
from .metric_types import METRIC_NAMES_TO_CLASSES, RUNTIME, DISABLED, DEBUG, INHERIT, Metric
__all__ = ['getMetric', 'DISABLED', 'RUNTIME', 'DEBUG', 'INHERIT']
......
from .base import Metric, LeafMetric
from .base import Metric, LeafMetric, RUNTIME, DISABLED, INHERIT, DEBUG, EmbeddedSubmetrics
from .cps import ClicksPerTimeUnitMetric
from .simple import IntegerMetric, FloatMetric
from .percentile import PercentileMetric
from .registry import register_metric
from .registry import register_metric, METRIC_NAMES_TO_CLASSES
__all__ = ['Metric', 'LeafMetric', 'EmbeddedSubmetrics', 'RUNTIME', 'DEBUG', 'INHERIT',
'DISABLED', 'ClicksPerTimeUnitMetric', 'IntegerMetric', 'FloatMetric',
'PercentileMetric', 'register_metric', 'METRIC_NAMES_TO_CLASSES']
ALL_METRICS = [
]
METRIC_NAMES_TO_CLASSES = {
}
__all__ = ['METRIC_NAMES_TO_CLASSES', 'register_metric']
def register_metric(cls):
"""
Decorator to register your custom metrics
"""
ALL_METRICS.append(cls)
METRIC_NAMES_TO_CLASSES[cls.CLASS_NAME] = cls
return cls
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment