Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

part_max_used and disk_free are being incorrectly reported. #68

Closed
gbjtv opened this issue Nov 8, 2012 · 2 comments
Closed

part_max_used and disk_free are being incorrectly reported. #68

gbjtv opened this issue Nov 8, 2012 · 2 comments

Comments

@gbjtv
Copy link

gbjtv commented Nov 8, 2012

http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=251
http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=238
http://bugzilla.ganglia.info/cgi-bin/bugzilla/show_bug.cgi?id=317

This is still true for me when using 3.4. Can this get fixed?

@jbuchbinder
Copy link
Member

For reference, the patch in the original ticket is:

--- ganglia-3.4.0/libmetrics/linux/metrics.c    2012-05-02 22:20:36.000000000
+0200
+++ ganglia-3.4.0-fs/libmetrics/linux/metrics.c 2012-06-21 22:44:49.432917578
+0200
@@ -1174,9 +1174,9 @@
 float device_space(char *mount, char *device, double *total_size, double
*total_free)
 {
    struct statvfs svfs;
-   uint32_t blocksize;
-   uint32_t free;
-   uint32_t size;
+   double blocksize;
+   double free;
+   double size;
    /* The percent used: used/total * 100 */
    float pct=0.0;

@@ -1192,8 +1192,8 @@
    size  = svfs.f_blocks;
    blocksize = svfs.f_bsize;
    /* Keep running sum of total used, free local disk space. */
-   *total_size += size * (double) blocksize;
-   *total_free += free * (double) blocksize;
+   *total_size += size * blocksize;
+   *total_free += free * blocksize;
    /* The percentage of space used on this partition. */
    pct = size ? ((size - free) / (float) size) * 100 : 0.0;
    return pct;

@jbuchbinder
Copy link
Member

@vvuksan fixed this in commit 343646c#libmetrics/linux/metrics.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants