statAggregator
statAggregator - gets the aggregated statistics on a list of PGIDs.
SYNOPSIS
statAggregator sub-command options
DESCRIPTION
The statAggregator command is used to aggregate statistics for a range or list of ranges. In addition, the user selects which packetGroupStats to aggregate as well as the type of aggregation.
STANDARD OPTIONS
packetGroup
Specifies packet group statistics.
totalPGIDs
Specifies statistics on all PGIDs.
COMMANDS
The statAggregator command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
statAggregator cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the statAggregator command.
statAggregator calculate option [statList] [fromPgid] [toPgid]
Computes the aggregate statistics for the selected statistics on the selected range of PGIDs. Enter the option type from a list of options above. Statistics are retrieved and aggregated based on the [statList] options entered.
Statistic |
Description |
---|---|
minLatency |
Aggregate the minimum latency statistics. |
maxLatency |
Aggregate the maximum latency statistics |
maxminInterval |
Aggregate the interval between the minimum and maximum latency statistics |
averageLatency |
Aggregate the average latency |
totalFrames |
Aggregate the total number of frames |
totalByteCount |
Aggregate the total number of bytes |
smallSequenceError |
Aggregate small sequence errors |
bigSequenceError |
Aggregate big sequence errors |
reverseSequenceError |
Aggregate reverse errors |
totalSequenceError |
Aggregate the total number of sequence errors |
sequenceGaps |
Aggregate sequence gaps |
duplicateFrames |
Aggregate duplicate frames |
What type of aggregation is done is based on an algorithm entered.
Algorithm |
Description |
---|---|
avg |
Perform an average calculation on the retrieved statistics. |
min |
Find the minimum value for the retrieved statistics |
max |
Find the maximum value for the retrieved statistics. |
total |
Find the total number for the retrieved statistics. |
For example, to aggregate the average number of big sequence errors for packet groups 1 to 5, enter:
statAggregator calculate packetGroup bigSequenceError avg 1 5
More than one statistic and algorithm can be entered per command.
The computation of the aggregated statistics are available until the you either:
- issues a new request for calculate
- calls the setDefault method.
Retrieval of new data by the packetGroupStat get command will not clear existing aggregated statistics metrics.
statAggregator setDefault
Resets the statAggregator command to the factory defaults.
EXAMPLES
package req IxTclHal
set hostname loopback
if {[ixConnectToChassis $hostname] == $::TCL_ERROR} {
errorMsg "Error connecting to chassis"
return 1
}
set chasID [chassis cget -id]
set cardID 1
set portID 1
set fromPg 1
set toPg 200
if {[packetGroupStats get $chasID $cardID $portID $fromPg $toPg]} {
errorMsg "Error getting packetGroupStats for $chasID /
$cardID $portID"
return
}
# note that these are relative to the get, just like the
# getGroup command in packetGroupStats.
set range1 {10 100}
set range2 {150 200}
set pgIdRangeList [list $range1 $range2]
set pgIdRangeList {{10 100} {150 200}}
set statList {{minLatency {min max average}} {maxLatency {max}} / {totalFrames {total}} }
# this does the actual computation on last retrieved stats
statAggregator calculate packetGroup $statList $pgIdRangeList
foreach item [statAggregator cget -packetGroupStats] {
foreach {statName valueList} $item {
puts "Stat: $statName"
foreach value $valueList {
scan $value "%s %d" algorithm metric
puts "\t$algorithm: $metric"
}
}
}
*** Output will look like this:
Stat: minLatency
min: 42
Stat: maxLatency
max: 128
Stat: totalFrames
sum: 12
avg: 6
min: 5
max: 7
%