diff --git a/CHANGELOG.md b/CHANGELOG.md index 00a244bb454dd7413bf29803749c0ae17ed3a557..7e7d3a83b5923ce6d4801984872968c2c0b51b87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -# v2.17.22 +# v2.17.23 -* added empty context manager +* un-deprecated the `cps` metric diff --git a/docs/instrumentation/metrics.rst b/docs/instrumentation/metrics.rst index 932d0586206e74be135c50e791e7fd0da2fd32ac..1f48e590f858fd1b7bfe5e833884ae4f1ca391b0 100644 --- a/docs/instrumentation/metrics.rst +++ b/docs/instrumentation/metrics.rst @@ -85,6 +85,9 @@ are available: .. autoclass:: satella.instrumentation.metrics.metric_types.ClicksPerTimeUnitMetric :members: +.. note:: Normally you should use a counter and calculate a rate() from it, but since some + platforms suck at rate a decision was made to keep this. + * linkfail - for tracking whether given link is online or offline .. autoclass:: satella.instrumentation.metrics.metric_types.LinkfailMetric diff --git a/satella/__init__.py b/satella/__init__.py index fead275c2b9cdb2f46d2b7c7dc8d8631b1c36057..90911dcdd7cf1fc756016476dbfd86cde91bb810 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1 +1 @@ -__version__ = '2.17.22' +__version__ = '2.17.23a1' diff --git a/satella/instrumentation/metrics/metric_types/cps.py b/satella/instrumentation/metrics/metric_types/cps.py index ee103601f219620fcc2a9ce20b914ef561c1d2e9..72ef9e51c257ac6c30cd200f2869c1cca08b4379 100644 --- a/satella/instrumentation/metrics/metric_types/cps.py +++ b/satella/instrumentation/metrics/metric_types/cps.py @@ -1,7 +1,6 @@ import collections import time import typing as tp -import warnings from .base import EmbeddedSubmetrics from .registry import register_metric @@ -16,18 +15,15 @@ class ClicksPerTimeUnitMetric(EmbeddedSubmetrics): By default (if you do not specify otherwise) this will track calls made during the last second. - .. deprecated:: 2.14.22 - Use :class:`~satella.instrumentation.metrics.metric_types.CounterMetric` instead + This was once deprecated but out of platforms which suck at calculating derivatives of their + series (AWS, I'm looking at you!) this was decided to be undeprecated. """ - __slots__ = ('last_clicks', 'aggregate_children', 'cutoff_period', 'time_unit_vectors') + __slots__ = 'last_clicks', 'aggregate_children', 'cutoff_period', 'time_unit_vectors' CLASS_NAME = 'cps' def __init__(self, *args, time_unit_vectors: tp.Optional[tp.List[float]] = None, aggregate_children: bool = True, internal: bool = False, **kwargs): - warnings.warn('cps is deprecated and will be removed in Satella 3.0, ' - 'use a counter and calculate a rate() from it instead', - DeprecationWarning) super().__init__(*args, internal=internal, time_unit_vectors=time_unit_vectors, **kwargs) time_unit_vectors = time_unit_vectors or [1] self.last_clicks = collections.deque() # type: tp.List[float]