nsmcp::SystemLogPeers object method candidates (public)

 nsmcp::SystemLogPeers[i] candidates stats

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

Select bounded exact-peer samples from the full warning ranking.

Parameters:
stats (required)
Full-window authorized peer accumulator.
Returns:
Up to five ranked peers, each with at most two warning samples.

Testcases:
No testcase defined.
Source code:
set rows {}
dict for {peer count} [dict get $stats counts] {lappend rows [list $peer $count]}
set rows [lsort -integer -decreasing -index 1 [lsort -index 0 $rows]]
set result {}
foreach row [lrange $rows 0 4] {
    set peer [lindex $row 0]
    if {[dict exists $stats samples $peer]} {
        lappend result [dict create peer $peer count [lindex $row 1]  samples [dict get $stats samples $peer]]
    }
}
return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: