server: add tracing for graphql handling
This commit is contained in:
@@ -9,6 +9,7 @@ use log::{error, info, warn};
|
||||
use mailparse::{parse_content_type, parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
||||
use memmap::MmapOptions;
|
||||
use notmuch::Notmuch;
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::{
|
||||
compute_offset_limit,
|
||||
@@ -48,6 +49,7 @@ pub fn threadset_to_messages(thread_set: notmuch::ThreadSet) -> Result<Vec<Messa
|
||||
Ok(Vec::new())
|
||||
}
|
||||
|
||||
#[instrument(name="nm::count", skip_all, fields(query=?query))]
|
||||
pub async fn count(nm: &Notmuch, query: &Query) -> Result<usize, ServerError> {
|
||||
if !is_notmuch_query(query) {
|
||||
return Ok(0);
|
||||
@@ -56,6 +58,7 @@ pub async fn count(nm: &Notmuch, query: &Query) -> Result<usize, ServerError> {
|
||||
Ok(nm.count(&query)?)
|
||||
}
|
||||
|
||||
#[instrument(name="nm::search", skip_all, fields(query=?query))]
|
||||
pub async fn search(
|
||||
nm: &Notmuch,
|
||||
after: Option<i32>,
|
||||
@@ -99,6 +102,7 @@ pub async fn search(
|
||||
.collect())
|
||||
}
|
||||
|
||||
#[instrument(name="nm::tags", skip_all, fields(needs_unread=needs_unread))]
|
||||
pub fn tags(nm: &Notmuch, needs_unread: bool) -> Result<Vec<Tag>, ServerError> {
|
||||
let now = Instant::now();
|
||||
let unread_msg_cnt: HashMap<String, usize> = if needs_unread {
|
||||
@@ -140,6 +144,7 @@ pub fn tags(nm: &Notmuch, needs_unread: bool) -> Result<Vec<Tag>, ServerError> {
|
||||
Ok(tags)
|
||||
}
|
||||
|
||||
#[instrument(name="nm::thread", skip_all, fields(thread_id=thread_id))]
|
||||
pub async fn thread(
|
||||
nm: &Notmuch,
|
||||
thread_id: String,
|
||||
@@ -851,6 +856,7 @@ fn render_content_type_tree(m: &ParsedMail) -> String {
|
||||
)
|
||||
}
|
||||
|
||||
#[instrument(name="nm::set_read_status", skip_all, fields(query=?query, unread=unread))]
|
||||
pub async fn set_read_status<'ctx>(
|
||||
nm: &Notmuch,
|
||||
query: &Query,
|
||||
|
||||
Reference in New Issue
Block a user