Forum Discussion

Bernie_10630's avatar
Bernie_10630
Icon for Nimbostratus rankNimbostratus
Mar 05, 2012

High Low value in System.Statistics.get_global_statistics

I've been exploring iControl System.System Info and System.Statistics and don't understand the high/low values. In some case the high value is zero while in others its not. Could some explain this to me.

 

 

(Common.Statistic){

 

type = "STATISTIC_CLIENT_SIDE_BYTES_IN"

 

value =

 

(Common.ULong64){

 

high = 9

 

low = -393526359

 

}

 

time_stamp = 0

 

}

 

(Common.Statistic){

 

type = "STATISTIC_CLIENT_SIDE_BYTES_OUT"

 

value =

 

(Common.ULong64){

 

high = 30

 

low = -1655949687

 

}

 

time_stamp = 0

 

}

 

(Common.Statistic){

 

type = "STATISTIC_CLIENT_SIDE_PACKETS_IN"

 

value =

 

(Common.ULong64){

 

high = 0

 

low = 191824680

 

}

 

time_stamp = 0

 

}

 

(Common.Statistic){

 

type = "STATISTIC_CLIENT_SIDE_PACKETS_OUT"

 

value =

 

(Common.ULong64){

 

high = 0

 

low = 219471652

 

}

 

time_stamp = 0

 

}

 

  • Lots of history in that question. When we first developed iControl in 2001, the SOAP standard and encodings didn't support 64 bit numbers. To add to that, Java didn't support unsigned values so we were stuck signed ints for the high and low values (thus the negative numbers in some of them). We then had to find a way to turn our 64 bit statistic values into numbers that the various client toolkits supported. In hindsight, we probably should have also passed down a string with the 64 bit value in it.

     

     

    As for the high and low values, those are the high and low 32 bits of the 64 bit number.

     

     

    The calculation to convert a high and low 32bit value is this:

     

     

    64 bit value = ((unsigned long)high)^32 + (unsigned long)low.

     

     

    The fact that some are 0 and some aren't, just means the numbers are bigger.

     

     

    Hope this helps...

     

     

    -Joe

     

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    In hindsight, we probably should have also passed down a string with the 64 bit value in it.

     

     

    v11.2 perhaps ?

     

     

    :)

     

     

    H
  • I think the formula is bit shifted, not a power of 32, given the following result:

    statistics[] =
            (Common.Statistic){
               type = "STATISTIC_CLIENT_SIDE_BYTES_IN"
               value =
                  (Common.ULong64){
                     high = 97
                     low = 841866601
                  }
               time_stamp = 0
            },
            (Common.Statistic){
               type = "STATISTIC_CLIENT_SIDE_BYTES_OUT"
               value =
                  (Common.ULong64){
                     high = 390
                     low = 2041437072
                  }
               time_stamp = 0
            },
    

    The formula for the result would be

    value = high << 32 + low
    

    Giving value = (97 << 32) + 841,866,601 = 417,453,694,313

    The alternative would yield (97^32) + 841866601 = 3773075507922571775273744352333525624409237957166570158701128042