feat: ЛР6 - наблюдаемость OpenTelemetry, Grafana и исследование цены наблюдаемости

This commit is contained in:
Ильяс
2026-11-27 20:09:36 +03:00
parent 38a00e1930
commit c549409d7b
25 changed files with 2599 additions and 187 deletions
+11
View File
@@ -91,6 +91,17 @@ class BrokerPublisher:
self._channel = None
return False
async def get_queue_message_count(self) -> int:
try:
if self._channel is None or self._channel.is_closed:
await self.get_exchange()
if self._channel and not self._channel.is_closed:
q = await self._channel.get_queue(QUEUE_NAME)
return q.declaration_result.message_count
except Exception:
pass
return 0
async def close(self) -> None:
try:
if self._channel and not self._channel.is_closed: