• Vadim Kochan's avatar
    tc class: Show classes as ASCII graph · d954b34a
    Vadim Kochan authored
    Added new '-g[raph]' option which shows classes in the graph view.
    
    Meanwhile only generic stats info output is supported.
    
    e.g.:
    
    $ tc/tc -g class show dev tap0
    +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
    |    +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
    |    +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
    |    |    +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
    |    |
    |    +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
    |
    +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
         +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
         +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
         +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
    
    $ tc/tc -g -s class show dev tap0
    +---(1:2) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
    |    |    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
    |    |    rate 0bit 0pps backlog 0b 0p requeues 0
    |    |
    |    +---(1:40) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
    |    |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
    |    |          rate 0bit 0pps backlog 0b 0p requeues 0
    |    |
    |    +---(1:50) htb rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
    |    |    |     Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
    |    |    |     rate 0bit 0pps backlog 0b 0p requeues 0
    |    |    |
    |    |    +---(1:51) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
    |    |               Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
    |    |               rate 0bit 0pps backlog 0b 0p requeues 0
    |    |
    |    +---(1:60) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
    |               Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
    |               rate 0bit 0pps backlog 0b 0p requeues 0
    |
    +---(1:1) htb rate 6Mbit ceil 6Mbit burst 15Kb cburst 1599b
         |    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
         |    rate 0bit 0pps backlog 0b 0p requeues 0
         |
         +---(1:10) htb prio 0 rate 5Mbit ceil 5Mbit burst 15Kb cburst 1600b
         |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
         |          rate 0bit 0pps backlog 0b 0p requeues 0
         |
         +---(1:20) htb prio 0 rate 3Mbit ceil 6Mbit burst 15Kb cburst 1599b
         |          Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
         |          rate 0bit 0pps backlog 0b 0p requeues 0
         |
         +---(1:30) htb prio 0 rate 1Kbit ceil 6Mbit burst 15Kb cburst 1599b
                    Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
                    rate 0bit 0pps backlog 0b 0p requeues 0
    Signed-off-by: default avatarVadim Kochan <vadim4j@gmail.com>
    d954b34a
tc_class.c 11.9 KB