Browse Source

Add support for tera-byte size for Linux bcache. (#4719) (#5373)

Kamran Amini 6 years ago
parent
commit
81ff6e7308
1 changed files with 2 additions and 0 deletions
  1. 2 0
      collectors/proc.plugin/proc_diskstats.c

+ 2 - 0
collectors/proc.plugin/proc_diskstats.c

@@ -180,6 +180,8 @@ static unsigned long long int bcache_read_number_with_units(const char *filename
                 return (unsigned long long int)(value * 1024.0 * 1024.0);
             else if(*end == 'G')
                 return (unsigned long long int)(value * 1024.0 * 1024.0 * 1024.0);
+            else if(*end == 'T')
+                return (unsigned long long int)(value * 1024.0 * 1024.0 * 1024.0 * 1024.0);
             else if(unknown_units_error > 0) {
                 error("bcache file '%s' provides value '%s' with unknown units '%s'", filename, buffer, end);
                 unknown_units_error--;