Getting realtime traffic speeds from interface

Hi all,

Trying to get realtime traffic speed on PPPoE interfaces on a CCR, and with /interface/monitor-traffic I get this:

    name:  <pppoe-661806175A84>
       rx-packets-per-second:                   121
          rx-bits-per-second:              52.9kbps
    fp-rx-packets-per-second:                     0
       fp-rx-bits-per-second:                  0bps
         rx-drops-per-second:                     0
        rx-errors-per-second:                     0
       tx-packets-per-second:                   155
          tx-bits-per-second:             1553.0...
    fp-tx-packets-per-second:                     0
       fp-tx-bits-per-second:                  0bps
         tx-drops-per-second:                     0
        tx-errors-per-second:                     0

As you can see, once speed is above 1000kbps, it shows as 1553.0… which breaks the code used to process this. Can anyone suggest a fix to get up/down speeds without this happening?

Wait, is this with the API or SSH? I ask because your syntax is a mix of the two…

If you’re having code that processes this (rather than you simply reading this), consider using the API instead of SSH. The API will (or at least it should) give you all rates in fully readable “bps” values (that is, pure integer values) that you can then process as you see fit.

Thanks - this was a test using SSH before I move the code to use API. I’ll test using API then.

If it’s true that once speed is above 1000kbps, it shows as 1553.0… then report it to support@