mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-28 07:49:50 +00:00
core: reset servers stats api
This commit is contained in:
@@ -2268,6 +2268,7 @@ processChatCommand' vr = \case
|
||||
servers <- map (\ServerCfg {server} -> server) <$> withStore' (`getProtocolServers` users)
|
||||
let srvs = if null servers then L.toList defServers else servers
|
||||
pure $ map protoServer srvs
|
||||
ResetAgentServersStats -> lift (withAgent' resetAgentServersStats) >> ok_
|
||||
GetAgentWorkers -> lift $ CRAgentWorkersSummary <$> withAgent' getAgentWorkersSummary
|
||||
GetAgentWorkersDetails -> lift $ CRAgentWorkersDetails <$> withAgent' getAgentWorkersDetails
|
||||
GetAgentStats -> lift $ CRAgentStats . map stat <$> withAgent' getAgentStats
|
||||
@@ -7627,6 +7628,7 @@ chatCommandP =
|
||||
"/debug locks" $> DebugLocks,
|
||||
"/debug event " *> (DebugEvent <$> jsonP),
|
||||
"/get servers summary " *> (GetAgentServersSummary <$> A.decimal),
|
||||
"/reset servers stats" $> ResetAgentServersStats,
|
||||
"/get stats" $> GetAgentStats,
|
||||
"/reset stats" $> ResetAgentStats,
|
||||
"/get subs" $> GetAgentSubs,
|
||||
|
||||
@@ -507,6 +507,7 @@ data ChatCommand
|
||||
| DebugLocks
|
||||
| DebugEvent ChatResponse
|
||||
| GetAgentServersSummary UserId
|
||||
| ResetAgentServersStats
|
||||
| GetAgentStats
|
||||
| ResetAgentStats
|
||||
| GetAgentSubs
|
||||
|
||||
Reference in New Issue
Block a user