- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::nsmcp::ServerHistory
::nsmcp::ServerHistorycreate ... \
[ -adminExample (default "") ] \
[ -adminSummary (default "") ] \
[ -command (default "::ns_stats") ] \
[ -description (default "Query persisted ns_stats intervals for the authenticated server. For peak analysis use mode summary: up to 1000 samples per call aggregated into at most 128 metric series with ranges, unweighted sample means and peak interval bounds; cumulative counters are excluded. more=true requires following nextArguments; never treat sampling rates as one-second peaks. mode records (default) retains raw paging. Defaults to the last 10 completed minutes, with 100 records per page. Use lastMinutes, period previous-hour, or explicit from/to (Unix seconds; half-open interval, at most 24 hours). Return records, referenced topologies, persistence status and coverage including gaps, restarts, evictions and write failures. Never assume complete coverage from record count. Follow nextArguments unchanged for stable paging. Intermediate coverage describes a page; final coverage with windowExamined=true examines the entire requested window independently of cursor, including earlier-page gaps and resets. Inspect complete and incompleteReasons. storage reports global oldest/newest retained times, sample count and SQLite used/allocated bytes for retention sizing. Does not enable sampling or persistence. Requires separately configured ns_stats SQLite history. Process metrics remain process-wide.") ] \
[ -inputSchema (default " { "type": "object", "properties": { "mode": {"type": "string", "enum": ["records", "summary"], "default": "records"}, "lastMinutes": { "type": "integer", "minimum": 1, "maximum": 1440, "default": 10 }, "period": { "type": "string", "enum": [ "previous-hour" ] }, "from": { "type": "integer", "minimum": 0, "description": "Inclusive Unix epoch seconds" }, "to": { "type": "integer", "minimum": 1, "description": "Exclusive Unix epoch seconds" }, "limit": { "type": "integer", "minimum": 1, "maximum": 100, "default": 100 }, "cursor": { "type": "integer", "minimum": 0, "description": "Paging timestamp in microseconds; requires explicit from/to" } }, "additionalProperties": false } ") ] \
[ -name (default "server_history") ] \
[ -outputSchema (default "") ] \
[ -permission (default "diagnostics.runtime.read") ]
Defined in /usr/local/ns/tcl/nsmcp/stats-tools.tcl
Class Relations
Methods (to be applied on instances)
execute (scripted, public)
<instance of nsmcp::ServerHistory> execute context arguments
Read retained runtime-history observations. Validate the requested mode and bounds, and retain explicit history coverage and availability metadata.
- 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::ServerHistory> validate arguments
Validate runtime-history bounds and 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)