Class ::nsmcp::AccessAnalytics

::nsmcp::AccessAnalytics[i] create ... \
           [ -database:required database:required ] \
           [ -evictionLimit:integer (default "64") ] \
           [ -maxLineBytes:integer (default "65536") ] \
           [ -maxReadBytes:integer (default "16777216") ] \
           [ -maxRows:integer (default "2000000") ] \
           [ -maxSeconds:integer (default "2") ] \
           [ -mutex (default "") ] \
           [ -parser (default "::nsmcp::accessRecordParser") ] \
           [ -path:required path:required ] \
           [ -retentionSeconds:double (default "86400") ]

Defined in /usr/local/ns/tcl/nsmcp/log-peer-context.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nsmcp::AccessLogIngestor[i]
  • subclass: ::nsmcp::UnifiedAccessAnalytics[i]

Methods (to be applied on the object)

  • invalidRequestContextSQL (scripted, public)

     nsmcp::AccessAnalytics[i] invalidRequestContextSQL peerKey side

    Build the bounded SQL query for one side of a warning timestamp.

    Parameters:
    peerKey (required)
    Private peer digest as lowercase SHA-256 hex.
    side (required)
    Select requests before or at and after the warning.
    Returns:
    SQL with bind parameters for the time window.

    Testcases:
    No testcase defined.

Methods (to be applied on instances)

  • correlateDuplicatePeers (scripted, public)

     <instance of nsmcp::AccessAnalytics[i]> correlateDuplicatePeers \
        candidates total omitted

    Match bounded duplicate-parameter warnings to stored access requests. Called only for a peer-authorized summary. The identifier/time index bounds each lookup; ambiguous matches and missing retained addresses stay unknown.

    Parameters:
    candidates (required)
    At most 512 warning identifiers with time and direct metadata.
    total (required)
    All physical duplicate warnings in the selected window.
    omitted (required)
    Warnings without a usable identifier or beyond the bound.
    Returns:
    Typed JSON fields with peer and attention rankings.

    Testcases:
    No testcase defined.
  • correlateInvalidRequests (scripted, public)

     <instance of nsmcp::AccessAnalytics[i]> correlateInvalidRequests \
        samples redactor

    Return bounded all-status context for sampled invalid-request warnings. Query retained unified records by private peer digest and a short time range. Do not import logs, expose peer keys, or infer TCP connection identity.

    Parameters:
    samples (required)
    At most twelve dictionaries with timestamp, offset and peerKey.
    redactor (required)
    Output redactor for paths and self-reported User-Agents.
    Returns:
    JSON triples with sampled sequences, redirect counts and limits.

    Testcases:
    No testcase defined.
  • correlatePeerHistory (scripted, public)

     <instance of nsmcp::AccessAnalytics[i]> correlatePeerHistory \
        candidates redactor

    Read at most five peers and 128 recent requests per peer from partitions with a peer/time index. No unindexed fallback or log import is attempted.

    Parameters:
    candidates (required)
    redactor (required)

    Testcases:
    No testcase defined.
  • correlateWarnings (scripted, public)

     <instance of nsmcp::AccessAnalytics[i]> correlateWarnings samples \
        redactor

    Correlate bounded warning examples with retained access records. Use the existing start-time index only; do not scan raw logs or trigger ingestion or historical backfill. Peer addresses are never selected.

    Parameters:
    samples (required)
    Up to three dictionaries with requestIdentifier and timestamp; optional system-log User-Agent fields take precedence over the cached agent.
    redactor (required)
    Redactor object applied before returning diagnostic evidence.
    Returns:
    Rooted JSON triples with sampled evidence and explicit missing and ambiguous counts.

    Testcases:
    No testcase defined.
  • summary (scripted, public)

     <instance of nsmcp::AccessAnalytics[i]> summary options

    Summarize stored access traffic in one database snapshot. Compute coverage and aggregates together under the instance mutex, closing the session on every exit.

    Parameters:
    options (required)
    Tcl dictionary containing the operation options.
    Returns:
    The summary dictionary with aggregates and explicit coverage.

    Testcases:
    No testcase defined.
  • validateWindow (scripted, public)

     <instance of nsmcp::AccessAnalytics[i]> validateWindow options

    Validate summary windows and access-record filters. Keep supported filter options separate while the superclass validates time and bucket bounds.

    Parameters:
    options (required)
    Tcl dictionary containing the operation options.
    Returns:
    The normalized options dictionary, including retained filters.

    Testcases:
    No testcase defined.