nsmcp::SystemLogSummary object method addOrigin (public)

 nsmcp::SystemLogSummary[i] addOrigin statsVar metadata capacity

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

Update the caller's warning-origin accumulator with one record.

Parameters:
statsVar (required)
metadata (required)
capacity (required)

Testcases:
No testcase defined.
Source code:
upvar 1 $statsVar stats
dict incr stats recordCount
set auth [dict get $metadata authenticationState]
set counts [dict get $stats authenticationStates]
dict incr counts $auth
dict set stats authenticationStates $counts
if {![dict exists $metadata userAgent] || [dict get $metadata userAgent] eq ""} {
    dict incr stats unknownUserAgentRecords
    return
}
set agent [dict get $metadata userAgent]
set truncated [dict get $metadata userAgentMayBeTruncated]
if {$truncated} {
    dict incr stats truncatedUserAgentRecords
}
if {![dict exists $stats agents $agent]} {
    if {[dict size [dict get $stats agents]] >= $capacity} {
        dict incr stats omittedUserAgentRecords
        return
    }
    dict set stats agents $agent {count 0 authenticationStates {anonymous 0 authenticated 0 unknown 0} truncatedRecords 0}
}
set entry [dict get $stats agents $agent]
dict incr entry count
if {$truncated} {
    dict incr entry truncatedRecords
}
set counts [dict get $entry authenticationStates]
dict incr counts $auth
dict set entry authenticationStates $counts
dict set stats agents $agent $entry
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: