add metrics

This commit is contained in:
Vlad committed 2026-11-24 11:23:07 +03:00
1 parent fde869fd35
commit b1d34fc10c
8 files changed
+342 -4

No files matched your search

+3
View File
@@ -5,6 +5,7 @@ from __future__ import annotations
import codecs
import contextlib
import inspect
import time
from collections.abc import AsyncIterator
from datetime import UTC, datetime
from types import TracebackType
@@ -267,6 +268,7 @@ class S3Client:
dest_key = self._processed_key(key)
bucket = self._settings.s3_bucket
started = time.perf_counter()
try:
head = await self._client.head_object(Bucket=bucket, Key=key)
@@ -288,6 +290,7 @@ class S3Client:
src_key=key,
dest_key=dest_key,
size=size,
elapsed_s=round(time.perf_counter() - started, 2),
)
except ClientError:
logger.exception("Ошибка перемещения файла", key=key, dest_key=dest_key)