Improve tracing spans for notif counts and sliding-sync exts.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-10-22 07:05:03 +00:00
parent 7cbc2ee385
commit e53968d9eb
7 changed files with 10 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ use tuwunel_service::sync::Room;
use super::{Connection, SyncInfo, Window, extension_rooms_selector};
#[tracing::instrument(level = "trace", skip_all)]
#[tracing::instrument(name = "account_data", level = "trace", skip_all)]
pub(super) async fn collect(
sync_info: SyncInfo<'_>,
conn: &Connection,

View File

@@ -26,7 +26,7 @@ use tuwunel_service::sync::Connection;
use super::{SyncInfo, share_encrypted_room};
#[tracing::instrument(level = "trace", skip_all)]
#[tracing::instrument(name = "e2ee", level = "trace", skip_all)]
pub(super) async fn collect(
sync_info: SyncInfo<'_>,
conn: &Connection,

View File

@@ -13,7 +13,7 @@ use tuwunel_service::{rooms::read_receipt::pack_receipts, sync::Room};
use super::{Connection, SyncInfo, Window, extension_rooms_selector};
#[tracing::instrument(level = "trace", skip_all)]
#[tracing::instrument(name = "receipts", level = "trace", skip_all)]
pub(super) async fn collect(
sync_info: SyncInfo<'_>,
conn: &Connection,

View File

@@ -66,6 +66,7 @@ pub(super) async fn selector(
(window, lists)
}
#[tracing::instrument(name = "window", level = "debug", skip_all)]
async fn select_window<'a, Rooms>(
sync_info: SyncInfo<'_>,
conn: &Connection,

View File

@@ -4,7 +4,7 @@ use tuwunel_core::{self, Result};
use super::{Connection, SyncInfo};
#[tracing::instrument(level = "trace", skip_all)]
#[tracing::instrument(name = "to_device", level = "trace", skip_all)]
pub(super) async fn collect(
SyncInfo { services, sender_user, sender_device, .. }: SyncInfo<'_>,
conn: &Connection,

View File

@@ -13,7 +13,7 @@ use tuwunel_core::{
use super::{Connection, SyncInfo, Window, extension_rooms_selector};
#[tracing::instrument(level = "trace", skip_all)]
#[tracing::instrument(name = "typing", level = "trace", skip_all)]
pub(super) async fn collect(
sync_info: SyncInfo<'_>,
conn: &Connection,

View File

@@ -35,6 +35,7 @@ impl crate::Service for Service {
}
#[implement(Service)]
#[tracing::instrument(level = "debug", skip(self))]
pub fn reset_notification_counts(&self, user_id: &UserId, room_id: &RoomId) {
let count = self.services.globals.next_count();
@@ -53,6 +54,7 @@ pub fn reset_notification_counts(&self, user_id: &UserId, room_id: &RoomId) {
}
#[implement(Service)]
#[tracing::instrument(level = "debug", skip(self), ret)]
pub async fn notification_count(&self, user_id: &UserId, room_id: &RoomId) -> u64 {
let key = (user_id, room_id);
self.db
@@ -64,6 +66,7 @@ pub async fn notification_count(&self, user_id: &UserId, room_id: &RoomId) -> u6
}
#[implement(Service)]
#[tracing::instrument(level = "debug", skip(self), ret)]
pub async fn highlight_count(&self, user_id: &UserId, room_id: &RoomId) -> u64 {
let key = (user_id, room_id);
self.db
@@ -75,6 +78,7 @@ pub async fn highlight_count(&self, user_id: &UserId, room_id: &RoomId) -> u64 {
}
#[implement(Service)]
#[tracing::instrument(level = "debug", skip(self), ret)]
pub async fn last_notification_read(&self, user_id: &UserId, room_id: &RoomId) -> u64 {
let key = (room_id, user_id);
self.db