::nsmcp::ServerRuntime ::nsmcp::ServerRuntime execute mode validate ::nsmcp::StatsTool ::nsmcp::StatsTool available encode unavailable ::nsmcp::ServerRuntime->::nsmcp::StatsTool ::nsmcp::ServerTopology ::nsmcp::ServerTopology execute ::nsmcp::ServerTopology->::nsmcp::StatsTool ::nsmcp::ServerHistory ::nsmcp::ServerHistory execute options validate ::nsmcp::ServerHistory->::nsmcp::StatsTool ::nsmcp::Tool ::nsmcp::Tool describe execute name permission validate ::nsmcp::StatsTool->::nsmcp::Tool

Class ::nsmcp::ServerRuntime

::nsmcp::ServerRuntime[i] create ... \
           [ -command (default "::ns_stats") ] \
           [ -description (default "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.") ] \
           [ -inputSchema (default "{} 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}") ] \
           [ -name (default "server_runtime") ] \
           [ -outputSchema (default "") ] \
           [ -permission (default "diagnostics.runtime.read") ]

Defined in /usr/local/ns/tcl/nsmcp/lib/stats-tools.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nsmcp::StatsTool[i]
::nx::Class create ::nsmcp::ServerRuntime \
     -superclass ::nsmcp::StatsTool

Methods (to be applied on instances)

  • execute (scripted, public)

     <instance of nsmcp::ServerRuntime[i]> execute context arguments
    Parameters:
    context (required)
    arguments (required)

    Testcases:
    No testcase defined.
    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]]]
  • validate (scripted, public)

     <instance of nsmcp::ServerRuntime[i]> validate arguments
    Parameters:
    arguments (required)

    Testcases:
    No testcase defined.
    if {[catch {:mode $arguments} message]} {
        return -code error -errorcode {NSMCP RPC -32602} $message
    }