nsmcp::EpisodeOverview method diskTrends (protected)

 <instance of nsmcp::EpisodeOverview[i]> diskTrends historyFields

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

Parameters:
historyFields (required)

Testcases:
No testcase defined.
Source code:
lassign [:field $historyFields poolThreads] type threads
if {$type ne "object"} {
    return {available boolean false reason string thread-history-unavailable}
}
lassign [:field $threads resourceIndicators] type resources
if {$type ne "object"} {
    return {available boolean false reason string resource-indicators-unavailable}
}
lassign [:field $resources disks] type disks
if {$type ne "object" || $disks eq {}} {
    return {available boolean false reason string disk-history-unavailable}
}
# Reuse the history pass. Keep only the two devices with the most
# observed I/O operations, rather than returning every resource
# series in the first-pass overview.
set ranked {}
foreach {name diskType fields} $disks {
    if {$diskType ne "object"} {continue}
    set reads [:series $fields readOpsPerSecond]
    set writes [:series $fields writeOpsPerSecond]
    set seconds [:series $fields observedSeconds]
    set operations 0.0
    for {set i 0} {$i<[llength $seconds]} {incr i} {
        set duration [lindex $seconds $i]
        if {![string is double -strict $duration] || $duration<=0} {continue}
        foreach rate [list [lindex $reads $i] [lindex $writes $i]] {
            if {[string is double -strict $rate] && $rate>0} {
                set operations [expr {$operations+$rate*$duration}]
            }
        }
    }
    if {$operations>0} {lappend ranked [list $operations $name $fields]}
}
if {$ranked eq {}} {
    return {available boolean false reason string no-observed-disk-operations}
}
set selected {}
foreach entry [lrange [lsort -real -decreasing -index 0 $ranked] 0 1] {
    lassign $entry operations name fields
    lappend selected $name object [:selectedFields $fields {
        readLatencyMs writeLatencyMs averageQueueDepth
        readOpsPerSecond writeOpsPerSecond observedSeconds sampleCount
    }]
}
set result [:selectedFields $resources {from to bucketSeconds coverage}]
lappend result disks object $selected omittedDisks number  [expr {[llength $ranked]-[llength $selected]/3}]  selection string highest-observed-io-operations  limitations string {Disk latencies are operation-weighted per observed bucket. A high read latency with few completed reads is weak evidence of sustained contention. Missing baselines, resets and history gaps remain null. Device counters include all users, not only NaviServer; time alignment does not establish cause.}
return [linsert $result 0 available boolean true]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: