nsmcp::SystemLogUrls object method add (public)

 nsmcp::SystemLogUrls[i] add statsVar text timestamp identifier redactor \
    [ truncated ] [ capacity ]

Defined in /usr/local/ns/tcl/nsmcp/log-summary-urls.tcl

Update the caller’s URL accumulator from one warning diagnostic.

Parameters:
statsVar (required)
text (required)
timestamp (required)
identifier (required)
redactor (required)
truncated (optional, defaults to "false")
capacity (optional, defaults to "4096")

Testcases:
No testcase defined.
Source code:
upvar 1 $statsVar stats
dict incr stats recordCount
if {$truncated} {
    dict incr stats truncatedRecordCount
}
set request [::nsmcp::summaryRequestUrl $text]
set method [dict get $request method]
set counts [dict get $stats methods]
dict incr counts $method
dict set stats methods $counts
set path [dict get $request path]
if {$path eq {}} {
    dict incr stats unknownUrlRecords
    if {[dict get $request reason] eq "oversized"} {
        dict incr stats oversizedUrlRecords
    }
    if {[dict get $request reason] eq "conflicting"} {
        dict incr stats conflictingUrlRecords
    }
    return
}
dict incr stats recordsWithUrl
if {![dict exists $stats urls $path]} {
    if {[dict size [dict get $stats urls]] >= $capacity} {
        dict incr stats capacityOmittedRecords
        return
    }
    set id {}
    if {[string length $identifier]<=256 && [::nsmcp::logRecordParser validConnectionIdentifier $identifier]} {
        set id $identifier
    }
    dict set stats urls $path [dict create count 0 firstAt $timestamp lastAt $timestamp methods {}  authenticationStates {anonymous 0 authenticated 0 unknown 0} representativeRequestIdentifier $id]
}
set entry [dict get $stats urls $path]
dict incr entry count
dict set entry firstAt [expr {min([dict get $entry firstAt],$timestamp)}]
dict set entry lastAt [expr {max([dict get $entry lastAt],$timestamp)}]
set counts [dict get $entry methods]
dict incr counts $method
dict set entry methods $counts
set origin [::nsmcp::SystemLogSummary requestMetadata $text $redactor]
set counts [dict get $entry authenticationStates]
dict incr counts [dict get $origin authenticationState]
dict set entry authenticationStates $counts
dict set stats urls $path $entry
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: