Forum Discussion

AlexBCT's avatar
AlexBCT
Icon for Cumulonimbus rankCumulonimbus
May 12, 2021

iStats Gauge and String options - any experience?

Hi,

 

When working with iStats, there is an option to configure the metrics as a Counter, Gauge and String. As far as I understand it, the Gauge gives an average value of all values given to it, and the string puts them all together, but does anyone know exactly how many values it takes for these, or how these exactly work?

 

For example, does the Gauge option give you an average of the last 50 values? And how many values can the String option take, or is that limited to a number of bytes? I doubt that either one would be working with an infinite set of numbers.

 

It looks like the official documentation for these mention the options, but not the exact mechanisms.

 

Thanks!

  • Yes, it's exactly as you said.

    ​An example of decrementing a gauge value is:

    istats incr "uri /api gauge curr_reqs" -- -3

    Regards,

    Dario.

  • Hello AlexBCT.

    Counter, Gauge and String are just measure types, not a format types.

    String is a text, and the difference between counter and gauge is bit sutil (similar to counter and gauge difference in SNMP).

    F5-BIGIP-LOCAL-MIB::ltmServerSslMaxActiveHandshake."/Common/crypto-client-default-serverssl" = Gauge32: 0
    F5-BIGIP-LOCAL-MIB::ltmServerSslStatHandshakeFailures."/Common/serverssl" = Counter64: 0

    Counters only increase, but gauge could increase or decrease (it allows you to set a negative increment).

    [root@spissa:Active:Standalone] alertd # istats -help
    Usage: istats <operation> [-s <segment-filename>] <key> [<value>]
       <operation> is one of: 'set' 'incr' 'get' 'remove' 'dump' 'drop_row'
               'drop_column' 'clear_row'
       <key> is a single quoted argument: "keyspace <table> <column> <value> ... <type> <measure>"
               (like "ltm.pool /Common/mypool counter mystat")
       <type> is one of: 'counter' 'gauge' 'string' 'text' 'signed' 'unsigned' 'bin'
               'dec' 'hex' 'timestamp' 'timeval' 'uinthex'
       <value> must be specified for 'set' and 'incr', and must be an integer for 'incr'
               The <value> for a gauge may be negative.  Use 2 dashes before the
               negative value (like 'incr "... gauge ..." -- -1')

    Regards,

    Dario.

    • Twpsyn_'s avatar
      Twpsyn_
      Icon for Nimbostratus rankNimbostratus

      So conceptually you might use a counter to record say the total connections handled by an iRule (incrementing on client_accept) and a guage to record the current connections (incrementing on client_accept, decrementing on client_closed)?

      • Yes, it's exactly as you said.

        ​An example of decrementing a gauge value is:

        istats incr "uri /api gauge curr_reqs" -- -3

        Regards,

        Dario.