conditionalStats
conditionalStats - works together with conditionalTable to configure and retrieve the flow detective stats from the port CPU.
SYNOPSIS
conditionalStats sub-command options
DESCRIPTION
The conditionalStats command is used to define the methods and parameters of the main configuration and stat retrieval object.
STANDARD OPTIONS
fromPGID
First PGID in range to monitor.
toPGID
Last PGID in range to monitor.
fromStreamId
First stream ID in range to monitor.
toStreamId
Last stream ID in range to monitor.
COMMANDS
The conditionalStats command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
conditionalStats cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the conditionalStats command.
conditionalStats config option value
Modify the Conditional Stats configuration options of the port. If no option is specified, returns a list describing all of the available Conditional Stats options (see STANDARD OPTIONS) for port.
conditionalStats get chasID cardID portID conditionID
Gets the current Conditional Stats for the port with conditionID, id portID on card cardID, chassis chasID.
Note: Note: Add a delay (4000 ms) before the conditionalStats get sub-command.
conditionalStats setDefault
Sets to IxTclHal default values for all configuration options.
conditionalStats set chasID cardID portID
Sets the Conditional Stats configuration of the port with id portID on card cardID, chassis chasID by reading the configuration option values set by the conditionalStats config option value command.
conditionalStats getrow rowIndex
Returns list of the form {colName1 value} {colName2 value} etc, with the first colName1 pre-defined as the index column. Error returns empty string.
conditionalStats start chasID cardID portID conditionID
Starts the collection of stats, based on the preset condition specified by conditionalTable.
Note: Note: Add a delay (4000 ms) after ixWriteConfigToHardware and before the conditionalStats start sub-command.
conditionalStats stop chasID cardID portID conditionID
Stops the collection of stats, based on the preset condition specified by conditionalTable.
EXAMPLES
package req IxTclHal
set hostname loopback
if {[ixConnectToChassis $hostname] == $::TCL_ERROR} {
errorMsg "Error connecting to chassis"
return 1
}
# skipping all the stream config stuff here...
conditionalTable setDefault
conditaionlStats setDefault
set conditionId_max 32
conditionalTable config -columnNames {"Total Frames" "MaxLatency > 100000"}
conditionalTable config -sortingExpression "minLatency < 100000"
conditionalTable config -numResults 100
if {[conditionalTable set $conditionId_max]} {
errorMsg "Error setting conditionalTable - $::ixErrorInfo"
return "FAIL"
}
set conditionId_min 42
conditionalTable config -columnNames {"Total Frames" "MinLatency < 1000"}
conditionalTable config -sortingExpression "minLatency < 1000"
conditionalTable config -numResults 100
if {[conditionalTable set $conditionId_min]} {
errorMsg "Error setting conditionalTable - $::ixErrorInfo"
return "FAIL"
}
conditionalStats config -fromPGID 0
conditionalStats config -toPGID 10000
if {[conditionalStats set $chassis $card $port]} {
errorMsg "Error configuring conditionalStats on port $chassis $card $port"
return "FAIL"
}
ixClearStats portList
ixStartTransmit portList
if {[conditionalStats start $chassis $card $port $conditionId_min]} {
errorMsg "Error starting conditionalStats on port $chassis $card $port"
return "FAIL"
}
# maybe wait for a bit to let some stats accummulate..?
after 2000
# when you're ready, read some stats but just for the first 5 rows, let's say...
set fromRowIndex 0
set toRowIndex 5
if {[conditionalStats get $chassis $card $port $conditionId]} {
errorMsg "Error getting conditionalStats on port $chassis $card $port, condition = $conditionId"
break
}
# row stats to be returned in the format:
# {{rowIndex $rowNumber} {$colName1 $colValue1} {$colName2 $colValue2} ... {$colNameN $colValueN}}
foreach {set row 0} {$row < [conditionalTable cget -numResults]} {incr row} {
set rowList [conditionalStats getRow $row]
if {[llength $rowList]} {
errorMsg "Hmm... no stats for $row..."
break
}
array set rowArray [join $rowList]
foreach {columnName value} [join $rowList] {
ixPuts -nownewline [format "%-30s\t" $name]
}
ixPuts
foreach columnName [array names $rowArray] {
ixPuts -nonewline [format "%-30ld\t" $rowArray(columnName)]
}
ixPuts
}
after $abit
# so now you decide to look at stats from a different set of conditions...
# so I assume you have to stop & start different ones...?
if {[conditionalStats stop $chassis $card $port $conditionId_min]} {
errorMsg "Error stopping conditionalStats on port $chassis $card $port"
return "FAIL"
}
if {[conditionalStats start $chassis $card $port $conditionId_max]} {
errorMsg "Error starting conditionalStats on port $chassis $card $port"
return "FAIL"
}