Additional span logging of counter state; trace logging of contents.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-29 22:42:10 +00:00
parent 59b62b1453
commit 1bb16c8b73
9 changed files with 101 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ mod data;
use std::{
collections::HashMap,
fmt::Write,
ops::Range,
sync::{Arc, RwLock},
time::Instant,
};
@@ -105,22 +106,40 @@ impl crate::Service for Service {
impl Service {
#[inline]
#[tracing::instrument(level = "trace", skip(self))]
#[tracing::instrument(
level = "trace",
skip_all,
ret,
fields(pending = ?self.pending_count()),
)]
pub async fn wait_pending(&self) -> Result<u64> { self.db.wait_pending().await }
#[inline]
#[tracing::instrument(level = "trace", skip(self))]
#[tracing::instrument(
level = "trace",
skip_all,
ret,
fields(pending = ?self.pending_count()),
)]
pub async fn wait_count(&self, count: &u64) -> Result<u64> { self.db.wait_count(count).await }
#[inline]
#[must_use]
#[tracing::instrument(level = "debug", skip(self))]
#[tracing::instrument(
level = "debug",
skip_all,
fields(pending = ?self.pending_count()),
)]
pub fn next_count(&self) -> data::Permit { self.db.next_count() }
#[inline]
#[must_use]
pub fn current_count(&self) -> u64 { self.db.current_count() }
#[inline]
#[must_use]
pub fn pending_count(&self) -> Range<u64> { self.db.pending_count() }
#[inline]
#[must_use]
pub fn server_name(&self) -> &ServerName { self.server.name.as_ref() }