::nsmcp::ServerRuntime ::nsmcp::ServerRuntime → schedulerComparison execute mode schedulerDiagnostics 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 compactHistory execute nonnegativeDelta numericArray numericOrNullArray options poolThreads validate ::nsmcp::ServerHistory->::nsmcp::StatsTool ::nsmcp::Tool ::nsmcp::Tool dependenciesPresent describe execute init jsonArguments name permission validate ::nsmcp::StatsTool->::nsmcp::Tool ::nsmcp::Object ::nsmcp::Object ::nsmcp::Tool->::nsmcp::Object

Class ::nsmcp::ServerHistory

::nsmcp::ServerHistory[i] create ... \
           [ -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. Mode pool-threads returns sampled busy and maximum connection threads, per-sample busy/current percentages summarized by bucket mean and maximum, waiting requests, and connection-slot occupancy against historical maxconnections per pool by minute or coarser bucket, plus process-wide database-pool SQL/handle-wait and block-device I/O indicators. capacityReachedSamples counts retained observations at the pool's connection-slot limit; sockets held by a driver after that limit are outside the pool waiting gauge. driverBacklog.peakDetails gives each reported driver's contribution in the single sample with the largest process-wide waiting-socket total. Sampling can miss shorter peaks, and the separately read thread and waiting gauges are not atomic. Counts, durations, rates and sampled thread gauges have different units; missing intervals remain null. mode records (default) retains raw paging. Use lastMinutes, period previous-hour, or explicit from/to (Unix seconds; half-open interval, at most 24 hours). Return persistence status and coverage including gaps, restarts, evictions and write failures. Never assume complete coverage from record count. Does not enable sampling or persistence. Requires separately configured ns_stats SQLite history.") ] \
           [ -inputSchema (default " { "type": "object", "properties": { "mode": {"type": "string", "enum": ["records", "summary", "pool-threads"], "default": "records"}, "pool": {"type": "string", "description": "Exact connection pool or all; required for pool-threads"}, "bucketSeconds": {"type": "integer", "enum": [60, 300, 900, 3600], "description": "pool-threads only; defaults to 900 for windows over six hours, 300 over three hours, otherwise 60"}, "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

  • class: ::nx::Class[i]
  • superclass: ::nsmcp::StatsTool[i]

Methods (to be applied on instances)

  • execute (scripted, public)

     <instance of nsmcp::ServerHistory[i]> 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[i]> 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.