Remove processing metrics (ProcessingMetricsData)
Processing metrics were an early addition that predated a clear understanding of what timing measurements matter in real-time pipelines. They were inconsistently implemented across services, often broken, and overlapped with the better-defined TTFB metric. - Remove ProcessingMetricsData class and all start/stop_processing_metrics methods from FrameProcessorMetrics, FrameProcessor, and SentryMetrics - Remove all processing metrics calls from 31 service files (LLM, TTS, STT, image, vision, realtime) - Clean up empty _start_metrics() stubs left in STT services - Remove processing metrics handling from RTVI, metrics log observer, pipeline task initial metrics, and strands agents framework - Update tests and examples Remaining metrics (TTFB, LLM token usage, TTS character usage, text aggregation time) are well-defined and consistently implemented.
This commit is contained in:
@@ -61,8 +61,6 @@ async def test_openai_llm_emits_error_frame_on_timeout():
|
||||
)
|
||||
|
||||
# Mock metrics methods
|
||||
service.start_processing_metrics = AsyncMock()
|
||||
service.stop_processing_metrics = AsyncMock()
|
||||
service.start_ttfb_metrics = AsyncMock()
|
||||
|
||||
# Create a context frame to process
|
||||
@@ -108,8 +106,6 @@ async def test_openai_llm_timeout_still_pushes_end_frame():
|
||||
service.push_error = AsyncMock()
|
||||
service._call_event_handler = AsyncMock()
|
||||
service._process_context = AsyncMock(side_effect=httpx.TimeoutException("Timeout"))
|
||||
service.start_processing_metrics = AsyncMock()
|
||||
service.stop_processing_metrics = AsyncMock()
|
||||
|
||||
context = LLMContext(
|
||||
messages=[{"role": "user", "content": "Hello"}],
|
||||
@@ -123,9 +119,6 @@ async def test_openai_llm_timeout_still_pushes_end_frame():
|
||||
assert LLMFullResponseStartFrame in frame_types
|
||||
assert LLMFullResponseEndFrame in frame_types
|
||||
|
||||
# Verify metrics were stopped
|
||||
service.stop_processing_metrics.assert_called_once()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_openai_llm_stream_closed_on_cancellation():
|
||||
@@ -208,8 +201,6 @@ async def test_openai_llm_emits_error_frame_on_exception():
|
||||
service.push_error = mock_push_error
|
||||
service._call_event_handler = AsyncMock()
|
||||
service._process_context = AsyncMock(side_effect=RuntimeError("API Error"))
|
||||
service.start_processing_metrics = AsyncMock()
|
||||
service.stop_processing_metrics = AsyncMock()
|
||||
|
||||
context = LLMContext(
|
||||
messages=[{"role": "user", "content": "Hello"}],
|
||||
|
||||
Reference in New Issue
Block a user