Forum Discussion
James_Waldrop_8
Nimbostratus
Sep 18, 2009Width/size of values?
What width data type are LocalLBPool statistics stored in? I'm getting this from test code:
| STATISTIC_SERVER_SIDE_BYTES_IN : 1922215810
| STATISTIC_SERVER_SIDE_BYTES_OUT : -1151353991
| STATISTIC_SERVER_SIDE_PACKETS_IN : 1374173472
| STATISTIC_SERVER_SIDE_PACKETS_OUT : -1836436750
This seems likely to be an overflow error, but I wanted to confirm.
TIA,
James
- JRahm
Admin
icontrol returns 32-bit high and low numbers, which you'll need to convert to a 64-bit number.function Convert-To64Bit(){ param($high, $low); $low = [Convert]::ToString($low,2).PadLeft(32,'0') if($low.length -eq "64") { $low = $low.substring(32,32) } return [Convert]::ToUint64([Convert]::ToString($high,2).PadLeft(32,'0')+$low,2); }
def get_wideip_stats(obj): try: stats = obj.get_all_statistics()['return'] except: "Unable to fetch wideip list or get statistics - check trace log" for x in stats['statistics']: print "WideIP: ", x['wide_ip'] print "\n"*2 for y in x['statistics']: value = y.get('value') high = value.get('high') low = value.get('low') value64 = (high<<32)|low print "\t", y.get('type') , value64
- James_Waldrop_8
Nimbostratus
Thanks, this makes a lot of sense. - James_Waldrop_8
Nimbostratus
Does anyone have sample code for the Java version of this? Java's lack of unsigned long is making me grumpy. - JRahm
Admin
Search the forums for java 64-bit if this doesn't help you, as there at least a few examples - JRahm
Admin
It is a 64 bit unsigned number: http://devcentral.f5.com/wiki/default.aspx/iControl/Common__ULong64.html - James_Waldrop_8
Nimbostratus
Ok, that code makes sense, thanks!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects