core: show count and average time for slow queries (#2939)

This commit is contained in:
spaced4ndy
2023-08-16 21:21:12 +04:00
committed by GitHub
parent 4a5dd0a3a4
commit 34cf672bc6
6 changed files with 19 additions and 7 deletions

View File

@@ -60,6 +60,7 @@ import Simplex.Messaging.Notifications.Protocol (DeviceToken (..), NtfTknStatus)
import Simplex.Messaging.Parsers (dropPrefix, enumJSON, parseAll, parseString, sumTypeJSON)
import Simplex.Messaging.Protocol (AProtoServerWithAuth, AProtocolType, CorrId, MsgFlags, NtfServer, ProtoServerWithAuth, ProtocolTypeI, QueueId, SProtocolType, UserProtocol, XFTPServerWithAuth)
import Simplex.Messaging.TMap (TMap)
import Simplex.Messaging.Agent.Store.SQLite.DB (SlowQueryStats (..))
import Simplex.Messaging.Transport (simplexMQVersion)
import Simplex.Messaging.Transport.Client (TransportHost)
import Simplex.Messaging.Util (allFinally, catchAllErrors, tryAllErrors)
@@ -805,7 +806,7 @@ data SendFileMode
data SlowSQLQuery = SlowSQLQuery
{ query :: Text,
duration :: Int64
queryStats :: SlowQueryStats
}
deriving (Show, Generic)