feat: добавлен сбор метрик: падения запросов к embeded модели; падения запросов к Qdrant, S3; скорости обработки новостей с выделением затраченного времени работы embeded - модели

This commit is contained in:
mike committed 2026-12-02 15:09:50 +03:00
1 parent dd0a124e36
commit a7974404a9
11 files changed
+287 -17

No files matched your search

+23
View File
@@ -394,6 +394,29 @@ async def test_process_file_single_object(
assert points[0].payload["object_index"] == 0
async def test_process_file_observes_duration_histogram(
pipeline, mock_s3_client, mock_csv_reader, mock_chunker, mock_embedding_provider
):
"""Успешная обработка файла увеличивает Histogram полного времени на 1."""
_mock_stream_lines(mock_s3_client, ["text,col", "hello,val"])
mock_csv_reader.iter_objects = _make_async_iter(
[ParsedObject(text="hello", metadata={"col": "val"})]
)
async def chunk_side_effect(text, metadata):
return [Chunk(text=text, index=0, metadata=metadata)]
mock_chunker.chunk.side_effect = chunk_side_effect
mock_embedding_provider.embed.return_value = [[0.1, 0.2, 0.3]]
before = REGISTRY.get_sample_value("etl_file_process_duration_seconds_count") or 0.0
await pipeline._process_file("input/data.csv")
after = REGISTRY.get_sample_value("etl_file_process_duration_seconds_count")
assert after == before + 1
async def test_process_file_adds_title_to_every_chunk_for_non_telegram_news(
pipeline, mock_s3_client, mock_csv_reader, mock_chunker, mock_embedding_provider, mock_repository
):