Revert "Deprecate processing metrics (ProcessingMetricsData)" (#3852)
This reverts commit 127b52bad5.
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
- Deprecated `ProcessingMetricsData` and `start_processing_metrics()`/`stop_processing_metrics()` on `FrameProcessor` and `FrameProcessorMetrics`. These metrics don't accurately depict a service's performance. Instead, TTFB metrics are recommended. Processing metrics will be removed in the 1.0.0 version.
|
|
||||||
@@ -41,10 +41,6 @@ class TTFBMetricsData(MetricsData):
|
|||||||
class ProcessingMetricsData(MetricsData):
|
class ProcessingMetricsData(MetricsData):
|
||||||
"""General processing time metrics data.
|
"""General processing time metrics data.
|
||||||
|
|
||||||
.. deprecated:: 0.0.104
|
|
||||||
Processing metrics are deprecated and will be removed in a future version.
|
|
||||||
Use TTFB metrics instead.
|
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
value: Processing time measurement in seconds.
|
value: Processing time measurement in seconds.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -441,35 +441,19 @@ class FrameProcessor(BaseObject):
|
|||||||
if frame:
|
if frame:
|
||||||
await self.push_frame(frame)
|
await self.push_frame(frame)
|
||||||
|
|
||||||
_processing_metrics_warned = False
|
|
||||||
|
|
||||||
async def start_processing_metrics(self, *, start_time: Optional[float] = None):
|
async def start_processing_metrics(self, *, start_time: Optional[float] = None):
|
||||||
"""Start processing metrics collection.
|
"""Start processing metrics collection.
|
||||||
|
|
||||||
.. deprecated:: 0.0.104
|
|
||||||
Processing metrics are deprecated and will be removed in a future version.
|
|
||||||
Use TTFB metrics instead.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
start_time: Optional timestamp to use as the start time. If None,
|
start_time: Optional timestamp to use as the start time. If None,
|
||||||
uses the current time.
|
uses the current time.
|
||||||
"""
|
"""
|
||||||
if self.can_generate_metrics() and self.metrics_enabled:
|
if self.can_generate_metrics() and self.metrics_enabled:
|
||||||
if not FrameProcessor._processing_metrics_warned:
|
|
||||||
FrameProcessor._processing_metrics_warned = True
|
|
||||||
logger.warning(
|
|
||||||
"Processing metrics are deprecated and will be removed in a future version. "
|
|
||||||
"Use TTFB metrics instead."
|
|
||||||
)
|
|
||||||
await self._metrics.start_processing_metrics(start_time=start_time)
|
await self._metrics.start_processing_metrics(start_time=start_time)
|
||||||
|
|
||||||
async def stop_processing_metrics(self, *, end_time: Optional[float] = None):
|
async def stop_processing_metrics(self, *, end_time: Optional[float] = None):
|
||||||
"""Stop processing metrics collection and push results.
|
"""Stop processing metrics collection and push results.
|
||||||
|
|
||||||
.. deprecated:: 0.0.104
|
|
||||||
Processing metrics are deprecated and will be removed in a future version.
|
|
||||||
Use TTFB metrics instead.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
end_time: Optional timestamp to use as the end time. If None, uses
|
end_time: Optional timestamp to use as the end time. If None, uses
|
||||||
the current time.
|
the current time.
|
||||||
|
|||||||
@@ -150,10 +150,6 @@ class FrameProcessorMetrics(BaseObject):
|
|||||||
async def start_processing_metrics(self, *, start_time: Optional[float] = None):
|
async def start_processing_metrics(self, *, start_time: Optional[float] = None):
|
||||||
"""Start measuring processing time.
|
"""Start measuring processing time.
|
||||||
|
|
||||||
.. deprecated:: 0.0.104
|
|
||||||
Processing metrics are deprecated and will be removed in a future version.
|
|
||||||
Use TTFB metrics instead.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
start_time: Optional timestamp to use as the start time. If None,
|
start_time: Optional timestamp to use as the start time. If None,
|
||||||
uses the current time.
|
uses the current time.
|
||||||
@@ -163,10 +159,6 @@ class FrameProcessorMetrics(BaseObject):
|
|||||||
async def stop_processing_metrics(self, *, end_time: Optional[float] = None):
|
async def stop_processing_metrics(self, *, end_time: Optional[float] = None):
|
||||||
"""Stop processing time measurement and generate metrics frame.
|
"""Stop processing time measurement and generate metrics frame.
|
||||||
|
|
||||||
.. deprecated:: 0.0.104
|
|
||||||
Processing metrics are deprecated and will be removed in a future version.
|
|
||||||
Use TTFB metrics instead.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
end_time: Optional timestamp to use as the end time. If None, uses
|
end_time: Optional timestamp to use as the end time. If None, uses
|
||||||
the current time.
|
the current time.
|
||||||
|
|||||||
Reference in New Issue
Block a user