Class ::nsmcp::EpisodeOverview

::nsmcp::EpisodeOverview[i] create ... \
           [ -adminExample (default "") ] \
           [ -adminSummary (default "") ] \
           [ -authorizer:required authorizer:required ] \
           [ -description (default "Align slow-request threshold signals, sampled busy/maximum threads and waiting requests per pool, rate-limited native pool-full Notice/Warning events and affected-request counts from at most the last 64 MiB of the current system log, and compact database/disk peaks plus selected disk trends in one fixed window. Defaults to the last 24 complete hours; a slow log over 64 MiB limits the first pass to six hours. Waiting and capacity are sampled gauges and can miss shorter peaks; driver-held requests are separate. Each suppressed repeat represents an additional request whose first queue attempt found the pool full; add the request that produced the logged event. Suppressed counts are placed by occurrence only when their bounded 60-second window fits one bucket; unallocated counts remain explicit. Report-time counts are retained for audit. Unread earlier bytes and rotations remain unknown. Database and disk indicators are process-wide; diskTrends includes at most two disks chosen by observed operation volume. Reports actual bounds, fallback and source coverage. Read-only; no ingestion, repair or configuration changes. Use access_slow_day and access_summary for a selected peak after reviewing this overview. Requires diagnostics.logs.read and diagnostics.runtime.read.") ] \
           [ -inputSchema (default " { "type": "object", "properties": { "hours": {"type": "integer", "enum": [1, 6, 24], "default": 24}, "pool": {"type": "string", "description": "Exact connection pool, or all (default)"} }, "additionalProperties": false } ") ] \
           [ -name (default "episode_overview") ] \
           [ -outputSchema (default "") ] \
           [ -permission (default "diagnostics.logs.read") ]

Defined in /usr/local/ns/tcl/nsmcp/episode-overview.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nsmcp::Tool[i]
::nx::Class create ::nsmcp::EpisodeOverview \
     -superclass ::nsmcp::Tool

Methods (to be applied on instances)

  • execute (scripted, public)

     <instance of nsmcp::EpisodeOverview[i]> execute context arguments
    Parameters:
    context (required)
    Authenticated, single-server diagnostic context.
    arguments (required)
    Rooted JSON argument triples.
    Returns:
    Fixed-window signals and pool history with independent coverage.

    Testcases:
    No testcase defined.
    ${:authorizer} require $context diagnostics.runtime.read
    if {[info commands ::nsmcp::tools] ne "" &&
        (![::nsmcp::tools enabled slow_requests] || ![::nsmcp::tools enabled server_history])} {
        error "episode_overview requires enabled slow_requests and server_history tools"
    }
    set options [:options $arguments]
    set server [$context server]
    set requestedHours [dict get $options hours]
    set hours $requestedHours
    set slowBytes [:slowLogBytes $server]
    set fallback none
    if {$hours==24 && $slowBytes>67108864} {
        set hours 6
        set fallback slow-log-over-64MiB
    }
    set bucket [expr {$hours==24 ? 900 : ($hours==6 ? 300 : 60)}]
    # Freeze at the last complete bucket. Both sources then return exactly
    # the requested number of whole buckets, with no partial edge buckets.
    set to [expr {([clock seconds]/$bucket)*$bucket}]
    set from [expr {$to-$hours*3600}]
    set pool [dict get $options pool]
    
    # Use the public tool entry point so its option parser supplies scan
    # defaults (notably scanStrategy) before the signal worker runs.
    set signalArgs [list {} object [list mode string signals pool string $pool  module string nslog from number $from to number $to bucketSeconds number $bucket]]
    set signals [::nsmcp::slow_requests execute $context $signalArgs]
    set signalFields [lindex $signals 2]
    set historyFields {}
    if {[info commands ::nsmcp::history] ne ""} {
        set historyArgs [list {} object [list mode string pool-threads pool string $pool  from number $from to number $to bucketSeconds number $bucket]]
        set history [::nsmcp::history execute $context $historyArgs]
        set historyFields [lindex $history 2]
    }
    set waitingHighlights [:waitingHighlights $historyFields $from $bucket]
    set droppedHighlights [:droppedHighlights $historyFields $from $bucket]
    set capacityHighlights [:capacityHighlights $historyFields $from $bucket]
    set highlights [:resourceHighlights $historyFields $from $bucket]
    set diskTrends [:diskTrends $historyFields]
    set backupActivity [:backupActivity $historyFields]
    if {[catch {:poolFullEvents $server $from $to $bucket} events]} {
        set events {available boolean false reason string current-system-log-scan-failed}
    }
    set coverage [list slowLogBytes [expr {$slowBytes<0 ? "null" : "number"}] $slowBytes  fallback string $fallback  threadHistory [expr {$historyFields eq "" ? "null" : "object"}] [:compactHistory $historyFields]  slowSignals object [:compactSignals $signalFields]]
    return [list {} object [list server string $server requestedHours number $requestedHours  actualHours number $hours from number $from to number $to bucketSeconds number $bucket  pool string $pool evidence object $coverage  waitingHighlights object $waitingHighlights  droppedHighlights object $droppedHighlights  capacityHighlights object $capacityHighlights  nativePoolFullEvents object $events resourceHighlights object $highlights  diskTrends object $diskTrends  backupActivity object $backupActivity  limitations string {Slow signals count overlapping threshold events from the current slow-request log. Native pool-full Notice/Warning events are rate limited and scanned from a bounded tail of the current system log. Pool history reports sampled concurrent threads, process-wide database and disk peaks, and selected disk trends with different units. Rotations, unread log bytes, history gaps and missing sources remain explicit in nested coverage. The database and disk indicators can coincide with slow requests but do not attribute an individual request or establish causation. This overview does not include access_slow_day timing repair.}]]
  • validate (scripted, public)

     <instance of nsmcp::EpisodeOverview[i]> validate arguments

    Validate a small closed input before the first source read.

    Parameters:
    arguments (required)

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