Add support for tera-byte size for Linux bcache. (#4719) (#5373)
Kamran Amini committed
Feb 13, 2019 at 11:05 UTC
81ff6e7308efa897fc37b61460e697f9fa76e32e
1 file changed
+2
collectors/proc.plugin/proc_diskstats.c
+2
@@ -180,6 +180,8 @@ static unsigned long long int bcache_read_number_with_units(const char *filename
180
return (unsigned long long int)(value * 1024.0 * 1024.0);
181
else if(*end == 'G')
182
return (unsigned long long int)(value * 1024.0 * 1024.0 * 1024.0);
183
+ else if(*end == 'T')
184
+ return (unsigned long long int)(value * 1024.0 * 1024.0 * 1024.0 * 1024.0);
185
else if(unknown_units_error > 0) {
186
error("bcache file '%s' provides value '%s' with unknown units '%s'", filename, buffer, end);
187
unknown_units_error--;