From fb113ff00864d002476f7557eb62d17414870c62 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:34:49 +0000 Subject: [PATCH] agent: include queries longer than 5ms into slow queries (was 50ms) --- src/Simplex/Messaging/Agent/Store/SQLite/DB.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Simplex/Messaging/Agent/Store/SQLite/DB.hs b/src/Simplex/Messaging/Agent/Store/SQLite/DB.hs index bfba973c1..2ae4eb731 100644 --- a/src/Simplex/Messaging/Agent/Store/SQLite/DB.hs +++ b/src/Simplex/Messaging/Agent/Store/SQLite/DB.hs @@ -48,7 +48,7 @@ timeIt slow sql a = do r <- a t' <- getCurrentTime let diff = diffToMilliseconds $ diffUTCTime t' t - atomically $ when (diff > 50) $ TM.alter (updateQueryStats diff) sql slow + atomically $ when (diff > 5) $ TM.alter (updateQueryStats diff) sql slow pure r where updateQueryStats :: Int64 -> Maybe SlowQueryStats -> Maybe SlowQueryStats