IP::stats

Description

This command supplies information about the number of packets or bytes being sent or received in a given connection.

Syntax

IP::stats
IP::stats pkts in
IP::stats pkts out
IP::stats pkts
IP::stats bytes in
IP::stats bytes out
IP::stats bytes
IP::stats age

Note - In v10.0 - 10.2.0, IP::stats keywords not functioning correctly. Reference cr136105 / BZ224422. The issue was resolved in v10.2.1 and 11.0.

IP::stats

  • Returns a list with Packets In, Packets Out, Bytes In, Bytes Out, & Age

IP::stats pkts in

  • Returns number of packets received

IP::stats pkts out

  • Returns number of packets sent

IP::stats pkts

  • Returns a Tcl list of packets in and packets out

IP::stats bytes in

  • Returns number of bytes received

IP::stats bytes out

  • Returns number of bytes sent

IP::stats bytes

  • Returns Tcl list of bytes in and bytes out

IP::stats age

  • Returns the age of the connection in milliseconds

Examples

The following example calculates and logs response time:
 when HTTP_REQUEST {
    set reqAge [IP::stats age]
    set reqURI [HTTP::uri]
    set reqClient [IP::remote_addr]:[TCP::remote_port]
 }
 when HTTP_RESPONSE {
    set respTime [expr {[IP::stats age] - $reqAge}]
    log local0. "Client at $reqClient requested $reqURI. \
Server response was received $respTime milliseconds after the request was sent to the server."
 }