improvement: reduce logging

This commit is contained in:
Greg Heartsfield 2022-12-22 10:29:27 -06:00
parent 168cf513ac
commit 53c2a8051c
2 changed files with 7 additions and 4 deletions

View File

@ -715,7 +715,10 @@ pub async fn db_query(
let mut row_count: usize = 0;
// generate SQL query
let (q, p) = query_from_sub(&sub);
debug!("SQL generated in {:?}", start.elapsed());
let sql_gen_elapsed = start.elapsed();
if sql_gen_elapsed > Duration::from_millis(10) {
debug!("SQL (slow) generated in {:?}", start.elapsed());
}
// show pool stats
log_pool_stats("reader", &pool);
// cutoff for displaying slow queries

View File

@ -248,10 +248,10 @@ pub fn start_server(settings: Settings, shutdown_rx: MpscReceiver<()>) -> Result
// limit concurrent SQLite blocking threads
.max_blocking_threads(settings.limits.max_blocking_threads)
.on_thread_start(|| {
debug!("started new thread");
trace!("started new thread");
})
.on_thread_stop(|| {
debug!("stopping thread");
trace!("stopping thread");
})
.build()
.unwrap();
@ -538,7 +538,7 @@ async fn nostr_server(
// TODO: serialize at broadcast time, instead of
// once for each consumer.
if let Ok(event_str) = serde_json::to_string(&global_event) {
debug!("sub match for client: {}, sub: {:?}, event: {:?}",
trace!("sub match for client: {}, sub: {:?}, event: {:?}",
cid, s,
global_event.get_event_id_prefix());
// create an event response and send it