Forum Discussion

Jordan_43509's avatar
Icon for Nimbostratus rankNimbostratus
Aug 16, 2011


Hello Everyone,



I've started working with the .NET Assembly of this project, I wanted to use it to get some statistics and monitoring of the BIG-IPs we have in our environment. Though I've hit a bit of a stumbling block.




Looking at the API it shows that the response from the BIG-IP for LocalLBPool.get_statistics(String[] poolNames) is a LocalLBPoolStatistics. This is a group of statistics which has has a ULong64 value inside which is broken into high (32bit) and a low value (32bit) to combine. The issue is that C recognizes the response types as Signed 64bit Ints.


How do I convert these two 64bit values into a 64 bit Unsigned long? Do I bit shift the high order value by 32 still? I already see issues where the low value in some cases are wrapping, however if I cast it as an unsigned 64bit int the two values do not represent what I see on the LB itself.








4 Replies

  • Hi Jordan, I should really just wrap a To64Bit function into the .Net assembly. Here's a little bit of code you can use to convert the Ulong64 structure into a 64 bit value.



    UInt64 build64(iControl.CommonULong64 ul64)
      return (UInt64)((UInt64)(ul64.high<<32) | (UInt64)ul64.low);



    BTW, The reason they are showing up as signed values is that when we designed the WSDL (back in 2002, there wasn't a unsigned type for our Java bindings so we had to go with what worked across all the languages).



    We are looking at moving our statistics interfaces to return strings with the 64-bit values and let languages do with them what they will, but that's a few releases off...



    Hope this helps...





  • Hi Joe,



    Thank you for the information! It was in the same direction I was headed earlier. I've tested out the code you provided and it seems to be giving correct results for most of my statistics however the STATISTIC_CLIENT_SIDE_BYTES_IN/OUT are still showing a very odd values...



    The BIGIP is showing a result of 66.0Gbits IN and 44.9Gbits OUT in the VS statistics but the output of the statistics are 18446744073373783348 and 5623161336


    if my math is correct 66.0Gbits should be 566935683072 bytes and 44.9Gbits should be 385688063180.8 bytes.


    Unless of course STATISTIC_CLIENT_SIDE_BYTES_IN/OUT is not the recorded statistic from the Overview >> Statistics: Virtual Servers page.



  • Let's go apples-to-apples here. In your first post, you mentioned you were looking at Pool statistics, but are now comparing them to VIP stats. The stats returned from iControl should be the same as the statistics option shows on the respective object pages. If you are seeing something inconsistent, if you could pass along the values in the GUI and then the high and low values from the ULong64 structure, I'll see if I can dig in a bit more.





  • Sorry for the confusion, I was originally working on Pool Stats then went over to Virtual Server stats because I thought maybe it was an error in the return data.



    The BIG-IP is showing the following:



    Details Bits IN Bits Out


    All 66.0G 45.0G


    Ephemeral 0 0


    Other 66.0G 45.0G




    Statistic Name High Low


    (No Cast) STATISTIC_CLIENT_SIDE_BYTES_IN 1 -331265964


    (No Cast) STATISTIC_CLIENT_SIDE_BYTES_OUT 1 1331262815


    (UInt64) STATISTIC_CLIENT_SIDE_BYTES_IN 1 18446744073378285652





    **Edit: Fixed formatting, made the data tables to make it easier to read.