Forum Discussion
Jason_44516
Nimbostratus
Sep 11, 2013iControl PoolMember stats returning a calculated negative value.
Hello, I have been working with the iControl for some time now in PowerShell and python. I have recently been working towards gathering statistics values through the iControl api. In testing the cont...
mhite_60883
Cirrocumulus
Sep 11, 2013Hard to read your code since it's all bunched up and not formatted right, but here's what you need to know about decoding statistics.
Values are return with a high order 32-bit signed value and low order 32-bit signed value. You need to combine these and turn them into a 64-bit unsigned integer value.
In Python, it would look something like this:
def convert_to_64_bit(high, low):
""" Converts two 32 bit signed integers to a 64-bit unsigned integer.
"""
if high < 0:
high = high + (1 << 32)
if low < 0:
low = low + (1 << 32)
value = long((high << 32) | low)
assert(value >= 0)
return valueHope this helps.
mhite_60883
Cirrocumulus
Sep 11, 2013It looks like it munged my code, too! Try this link: https://gist.github.com/mhite/cb01cc23a0fede93f335
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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