Use strtoull when available to parse network metrics on Linux #83

Merged
merged 1 commit into from Feb 7, 2013

Conversation

Projects
None yet
2 participants
@trevorr

trevorr commented Feb 6, 2013

Not sure if Bugzilla is still used, but I filed a bug over there: http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=342

In monitor-core/libmetrics/linux/metrics.c, strtoul is used to parse the network packet and byte counts from /proc/net/dev. On modern 32-bit systems (e.g. ARMv7), these counts are often 64-bit, whereas unsigned long is 32 bits. When the counts exceed ULONG_MAX, Ganglia incorrectly reports 0 network bytes in/out from then on.

This commit uses strtoull when it is available for parsing network stats.

jbuchbinder added a commit that referenced this pull request Feb 7, 2013

Merge pull request #83 from trevorr/bug342
Use strtoull when available to parse network metrics on Linux

@jbuchbinder jbuchbinder merged commit d17a120 into ganglia:master Feb 7, 2013

1 check passed

default The Travis build passed
Details

@trevorr trevorr deleted the trevorr:bug342 branch Feb 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment