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 ...
JRahm
Admin
Sep 18, 2009icontrol returns 32-bit high and low numbers, which you'll need to convert to a 64-bit number.
Powershell courtesy of Joe:
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);
}
In python, you can see in this function to get wide IP statistics the same math:
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
HTH...Jason
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
