From c087f2d281ae0f44dcf4944b8001e60de4b6c58b Mon Sep 17 00:00:00 2001 From: trivernis Date: Mon, 10 Jan 2022 22:20:29 +0100 Subject: [PATCH] Add more tracing Signed-off-by: trivernis --- mediarepo-daemon/mediarepo-model/src/file/filter.rs | 1 + .../mediarepo-socket/src/namespaces/files/searching.rs | 3 +++ .../mediarepo-socket/src/namespaces/files/sorting.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/mediarepo-daemon/mediarepo-model/src/file/filter.rs b/mediarepo-daemon/mediarepo-model/src/file/filter.rs index a2842e8..8ae234a 100644 --- a/mediarepo-daemon/mediarepo-model/src/file/filter.rs +++ b/mediarepo-daemon/mediarepo-model/src/file/filter.rs @@ -53,6 +53,7 @@ pub enum NegatableComparator { IsNot(T), } +#[tracing::instrument(level = "debug")] pub fn build_find_filter_conditions(filters: Vec>) -> Condition { filters .into_iter() diff --git a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs index 995298f..e15c6df 100644 --- a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs +++ b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs @@ -10,6 +10,7 @@ use mediarepo_model::file::{File, FileStatus}; use mediarepo_model::repo::Repo; use std::collections::HashMap; +#[tracing::instrument(level = "debug", skip(repo))] pub async fn find_files_for_filters( repo: &Repo, expressions: Vec, @@ -21,6 +22,7 @@ pub async fn find_files_for_filters( repo.find_files_by_filters(filters).await } +#[tracing::instrument(level = "debug")] fn get_tag_names_from_expressions(expressions: &Vec) -> Vec { expressions .iter() @@ -44,6 +46,7 @@ fn get_tag_names_from_expressions(expressions: &Vec) -> Vec>() } +#[tracing::instrument(level = "debug")] fn build_filters_from_expressions( expressions: Vec, tag_id_map: &HashMap, diff --git a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs index fd89c96..1f36770 100644 --- a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs +++ b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs @@ -24,6 +24,7 @@ pub struct FileSortContext { change_time: NaiveDateTime, } +#[tracing::instrument(level = "debug", skip(repo, files))] pub async fn sort_files_by_properties( repo: &Repo, sort_expression: Vec,