mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-05-13 23:03:15 +00:00
server: add control port commands for clients and ghc threads (#836)
* server: add control port commands for clients and ghc threads (#835) * Add stats-rts control query With supporting ghc-options that would provide the data. * Add CPSkip command Allows spamming empty lines a few times to clean up the view. * server: Add CP commands to enumerate clients and threads * style --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> * use base64 encoding for session ID * fromMaybe * whitespace --------- Co-authored-by: Alexander Bondarenko <486682+dpwiz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ed05428227
commit
7bdae793cb
@@ -11,9 +11,12 @@ data ControlProtocol
|
||||
| CPResume
|
||||
| CPClients
|
||||
| CPStats
|
||||
| CPStatsRTS
|
||||
| CPThreads
|
||||
| CPSave
|
||||
| CPHelp
|
||||
| CPQuit
|
||||
| CPSkip
|
||||
|
||||
instance StrEncoding ControlProtocol where
|
||||
strEncode = \case
|
||||
@@ -21,16 +24,22 @@ instance StrEncoding ControlProtocol where
|
||||
CPResume -> "resume"
|
||||
CPClients -> "clients"
|
||||
CPStats -> "stats"
|
||||
CPStatsRTS -> "stats-rts"
|
||||
CPThreads -> "threads"
|
||||
CPSave -> "save"
|
||||
CPHelp -> "help"
|
||||
CPQuit -> "quit"
|
||||
CPSkip -> ""
|
||||
strP =
|
||||
A.takeTill (== ' ') >>= \case
|
||||
"suspend" -> pure CPSuspend
|
||||
"resume" -> pure CPResume
|
||||
"clients" -> pure CPClients
|
||||
"stats" -> pure CPStats
|
||||
"stats-rts" -> pure CPStatsRTS
|
||||
"threads" -> pure CPThreads
|
||||
"save" -> pure CPSave
|
||||
"help" -> pure CPHelp
|
||||
"quit" -> pure CPQuit
|
||||
"" -> pure CPSkip
|
||||
_ -> fail "bad ControlProtocol command"
|
||||
|
||||
Reference in New Issue
Block a user