scollector: fix linux os.mem.used
An arithmetic error was introduced in the previous commit
@@ -75,7 +75,7 @@ func c_procstats_linux() (opentsdb.MultiDataPoint, error) {
memFree := mem["MemFree"]
Add(&md, osMemTotal, memTotal*1024, nil, metadata.Gauge, metadata.Bytes, osMemTotalDesc)
Add(&md, osMemFree, (memFree+bufferCacheSlab)*1024, nil, metadata.Gauge, metadata.Bytes, osMemFreeDesc)
- Add(&md, osMemUsed, (memTotal-memFree+bufferCacheSlab)*1024, nil, metadata.Gauge, metadata.Bytes, osMemUsedDesc)
+ Add(&md, osMemUsed, (memTotal-memFree-bufferCacheSlab)*1024, nil, metadata.Gauge, metadata.Bytes, osMemUsedDesc)
if memTotal != 0 {
Add(&md, osMemPctFree, (float64(memFree)+float64(bufferCacheSlab))/float64(memTotal)*100, nil, metadata.Gauge, metadata.Pct, osMemFreeDesc)
}
