- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::nsmcp::ServerRuntime
::nsmcp::ServerRuntimecreate ... \
[ -adminExample (default "") ] \
[ -adminSummary (default "") ] \
[ -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%. Also returns scheduler diagnostics from ns_info scheduler when supported: current process-lifetime cumulative timing counters, maxima and job IDs, collected at scheduler.observedAt independently of snapshot/sample time. Newer cores distinguish dispatchDelay (actual queue deadline to dequeue), workerQueueDelay (dequeue to worker pickup), threadedCallbacks runtime and callbackOverrun (completion beyond next nominal time), with current/peak workers and queue counts. Maximum context includes maxObservedAt (Unix seconds), bounded maxCallback text and maxCallbackTruncated when supported, including completed one-shot jobs. dispatchLateness retains nominal-time lateness and is not necessarily actual dispatch delay. Missing phase fields on older cores are unknown, not zero. Scheduler availability is explicit on older versions. scheduler.comparison compares cumulative counters with the previous successful server_runtime scheduler read on this virtual server, shared across callers/interpreters. The first read establishes a baseline; later reads report explicit from/to/elapsedSeconds and per-phase observationsDelta, over100msDelta, totalSecondsDelta, averageSeconds and newMaximum. Missing phases, process changes, resets and nonpositive intervals remain unavailable. Deltas cover all jobs, not specific callbacks or the warning window. Zero threshold crossings distinguish isolated maxima from recent delays above 100 ms but do not exclude smaller delays. Current workers/queues and lifetime maxima remain separate. Does not start or change sampling.") ] \
[ -inputSchema (default " { "type": "object", "properties": { "mode": { "type": "string", "enum": [ "snapshot", "sample" ], "default": "snapshot" } }, "additionalProperties": false } ") ] \
[ -name (default "server_runtime") ] \
[ -outputSchema (default "") ] \
[ -permission (default "diagnostics.runtime.read") ] \
[ -schedulerCommand (default "::ns_info") ] \
[ -schedulerStore (default "nsmcp:scheduler-observations") ]
Defined in /usr/local/ns/tcl/nsmcp/stats-tools.tcl
Class Relations
Methods (to be applied on instances)
execute (scripted, public)
<instance of nsmcp::ServerRuntime> execute context arguments
Read bounded runtime diagnostics for the selected server. Apply the validated inspection mode and retain unavailable capability and scheduler diagnostics.
- Parameters:
- context (required)
- Authenticated request context carrying the principal, grants and selected server.
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- Returns:
- A rooted JSON tool-result object, including availability or job metadata as appropriate.
- Testcases:
- No testcase defined.
validate (scripted, public)
<instance of nsmcp::ServerRuntime> validate arguments
Validate the runtime inspection mode. Decode the rooted JSON argument object and enforce this tool's option, range and combination constraints.
- Parameters:
- arguments (required)
- Rooted ns_json typed triples for the tool's JSON argument object.
- Returns:
- An empty result on success; invalid input raises RPC error -32602.
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
![[i]](/resources/acs-subsite/ZoomIn16.gif)