My goal is to fetch virtual servers/addresses statistics from LTM and display the value on screen. This is effectively mocking the device web console’s ‘Network Maps’. When queried for stats values of different types are returned in CommonULong64 class which contains two members High and Low. Could someone please guide me on how to convert these two values into one meanigful value (which displays on device web console)?
For ex. High = 2, Low = 477423268 converts to 99.2G
Multiply the high value by 2^32 and add it to the low to get a 64bit number. The code will vary depending on language… But in C it would be something like
unsigned long long result=high<<32+low;
(Assumes that the high and low are unsigned integers)
In perl it’ll vary, but you could try
my $quick64=($statValue->{high}*4294967296)+($statValue->{low}<0?(4294967296+$statValue->{low}):$statValue->{low});
Remember you need to treat the values as unsigned integers… if you treat them as signed, it’ll not work correctly.