core: reset servers stats api

This commit is contained in:
spaced4ndy
2024-06-26 11:02:34 +04:00
parent fba0478e50
commit 4128655467
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -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,
+1
View File
@@ -507,6 +507,7 @@ data ChatCommand
| DebugLocks
| DebugEvent ChatResponse
| GetAgentServersSummary UserId
| ResetAgentServersStats
| GetAgentStats
| ResetAgentStats
| GetAgentSubs