streamTransmitStats
streamTransmitStats - view per-stream transmit statistics
SYNOPSIS
streamTransmitStats sub-command options
DESCRIPTION
The streamTransmitStats command may be used to retrieve the per-stream transmit statistics. This is automatically enabled for all ports that support this feature; this may be checked through the use of the port isValidFeature... portFeaturePerStreamTxStats command.
Per-stream transmit stats are retrieved by the stream id <number> per configuration on the port. They vary per port per transmit mode. (For example, TXS8 cards are numbered from 1 to 255 for Packet Stream mode, and 1 to 128 for Advanced Scheduler mode. And for ATM cards, statistics can only be displayed for 127 streams.)
Statistics for a block of streams are retrieved through the use of the get command. Statistics for disabled streams are set to 0. Statistics for a particular stream are retrieved into the options of this command through the use of the getGroup command.
The getGroup command uses a `1' based index into the block of streams fetched in the get command. For example, if get was used to fetch streams 101 through 200, then the statistics for stream 105 may be obtained by calling getGroup for index 5.
STANDARD OPTIONS
frameRate
Read-only. 64-bit value. This is the transmit frame rate for the stream, expressed in frames per second. Note: this value is calculated on the difference between two successive readings; streamTransmitStats get must be called at least twice before valid values are obtained.
A value of 0 is returned for disabled streams.
framesSent
Read-only. 64-bit value. This is the number of frames transmitted. A value of 0 is returned for disabled streams.
numGroups
Read-only. This is the number of stream statistics read by the get command.
readTimeStamp
Read-only. Reads the timestamp from when the statistics of a port stream were obtained. .
lastTimeStamp
Read-only. 64-bit value. The last timestamp of the transmitted packet.
Note: Does not apply to LM622MR load module in ATM mode (only).
theoreticalAverageFrameRate
Read-only. Calculates the long-term average frame rate for each stream, based on current stream configuration.
COMMANDS
The streamTransmitStats command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
streamTransmitStats cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the streamTransmitStats command.
streamTransmitStats get chasID cardID portID [fromStream] [toStream]
Gets a block of transmit statistics for a range of streams on the indicated port. fromStream starts at '1', and toStream starts at '1'. If fromStream is omitted,"1" is used. If both fromStream and toStream are omitted, only the first stream's statistics are retrieved.
Statistics can only be collected for the first 127 streams on an ATM port.
Call this command before calling streamTransmitStats cget option.
streamTransmitStats getCircuit chasID cardID portID circuitID [fromGroupID] [toGroupID]
Gets a block of transmit statistics for a range of Group IDs on the indicated port and circuit. fromGroupID starts at "1", and toGroupID starts at "1". If fromGroupID is omitted, "1" is used. If both fromGroupID and toGroupID are omitted, only the first group's statistics is retrieved.
Call this command before calling streamTransmitStats cget option.
streamTransmitStats getgroup index
Gets the statistics for a particular stream. index is with respect to fromStream used in the last call to get. That is, if the last call to get were:
streamTransmitStats get $ch $ca $po 10 20
then index should be set to 2 if the statistics for stream 11 is required. Call this command before calling streamTransmitStats cget option.
streamTransmitStats getQueue chasID cardID portID queueID [fromStream] [toStream]
Gets a block of transmit statistics for a range of streams on the indicated port and queue, for ATM modules. fromStream starts at "1", and toStream starts at "1". If fromStream is omitted, "1" is used. If both fromStream and toStream are omitted, only the first stream's statistics is retrieved.
Statistics can only be collected for the first 127 streams on an ATM port.
Call this command before calling streamTransmitStats cget option.
streamTransmitStats setCalculateAverageFrameRate value
Disables the calculation for theoretical average frame rate if value is set to 0. Default value is set to 1.
EXAMPLES
package require IxTclHal
set host woodstock
set retCode "PASS"
# Check if we're running on UNIX - connect to the TCL Server
# which must be running on the chassis
if [isUNIX] {
if [ixConnectToTclServer $host] {
ixPuts "Could not connect to $host"
return "FAIL"
}
}
# Now connect to the chassis
if [ixConnectToChassis $host] {
ixPuts $::ixErrorInfo
return "FAIL"
}
set maxStreams 255
# Get the chassis ID to use in port lists
set chId [chassis cget -id]
set cardId 1
set portId 3
set portList [list [list $chId $cardId $portId]]
logMsg "Building streams..."
# Check if the port supports per-stream transmit stats
if {![port isValidFeature $chId $cardId $portId portFeaturePerStreamTxStats]} {
ixPuts "Card $cardId does not support per-stream transmit stats"
return "FAIL"
}
# Remove all the stream on the port
port reset $chId $cardId $portId
# Set up test streams
stream setDefault
for {set streamId 1} {$streamId <= $maxStreams} {incr streamId} {
stream config -name "test stream $streamId"
if { $streamId < $maxStreams } {
stream config -dma advance
} else {
stream config -dma firstLoopCount
stream config -loopCount 10000
}
stream config -numFrames 1
stream set $chId $cardId $portId $streamId
}
ixWriteConfigToHardware portList
ixCheckLinkState portList
ixClearStats portList
ixStartTransmit portList
# Get all of the stream stats
if [streamTransmitStats get $chId $cardId $portId 1 $maxStreams] {
errorMsg "Error getting streamTransmitStats on port $chId $cardId $portId"
return "FAIL"
}
# Get all of the stream stats again for a vaild reading
if [streamTransmitStats get $chId $cardId $portId 1 $maxStreams] {
errorMsg "Error getting streamTransmitStats on port $chId $cardId $portId"
return "FAIL"
}
ixPuts "Read [streamTransmitStats cget -numGroups] streams"
ixPuts "Group\tRate\tFrames Sent"
ixPuts "---------------------------------"
# Get data for each stream
for {set streamId 1} {$streamId <= $maxStreams} {incr streamId} {
if [streamTransmitStats getGroup $streamId] {
errorMsg "Error getting group $streamId on port $chId $cardId $portId"
set retCode "FAIL"
break
}
set frameRate [streamTransmitStats cget -frameRate]
set framesSent [streamTransmitStats cget -framesSent]
ixPuts "$streamId\t$frameRate\t$framesSent"
}
ixStopTransmit portList
ixClearStats portList
return $retCode