Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions hexus/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ def enqueue(
)
try:
self._queue.put_nowait(item)
logger.debug(
"hexus queue: enqueued write action=%s, agent=%s, target=%s",
action,
agent_identity,
target,
)
return True
except queue.Full:
with self._lock:
Expand Down Expand Up @@ -179,6 +185,13 @@ def _run(self) -> None:
t0 = time.perf_counter()
self._worker_fn(item)
duration = time.perf_counter() - t0
logger.debug(
"hexus queue: processed write action=%s, agent=%s, target=%s in %.4fs",
item.action,
item.agent_identity,
item.target,
duration,
)
with self._lock:
self._latencies.append(duration)
if len(self._latencies) > 1000:
Expand Down
Loading