Class ::nsmcp::ServerRuntime (public)
::nx::Class ::nsmcp::ServerRuntime
Defined in /usr/local/ns/tcl/nsmcp/lib/stats-tools.tcl
- Testcases:
- No testcase defined.
Source code: :property {name server_runtime} :property {description {Read ns_stats runtime diagnostics for the authenticated server. mode snapshot (default) collects current gauges and cumulative counters; mode sample returns the latest published interval rates and CPU percentages. sampling reports readiness, age and running state. Process CPU, drivers, allocator and database-pool metrics remain process-wide. Timestamp is epoch microseconds; phase times are seconds; CPU percentages use one core as 100%. Does not start or change sampling.}} :property {inputSchema {{} object {type string object properties object { mode object {type string string enum array {0 string snapshot 1 string sample} default string snapshot} } additionalProperties boolean false}}} :method mode {arguments} { if {[lindex $arguments 1] ne "object"} { error "Expected arguments object" } set mode snapshot foreach {key type value} [lindex $arguments 2] { if {$key ne "mode" || $type ne "string" || $value ni {snapshot sample}} { error "Supply only mode snapshot or sample" } set mode $value } return $mode } :public method validate {arguments} { if {[catch {:mode $arguments} message]} { return -code error -errorcode {NSMCP RPC -32602} $message } } :public method execute {context arguments} { if {![:available]} { return [:unavailable $context] } set mode [:mode $arguments] set data [${:command} $mode -server [$context server]] set status [${:command} sampling status] return [list {} object [list server string [$context server] available boolean true mode string $mode sampling object [:encode metrics $status] runtime object [:encode runtime $data]]] }XQL Not present: Generic, PostgreSQL, Oracle
![[i]](/resources/acs-subsite/ZoomIn16.gif)