Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Incorrect column headings in CSV file if showing memory #73

Closed
andriokha opened this issue Apr 26, 2014 · 0 comments
Closed

Incorrect column headings in CSV file if showing memory #73

andriokha opened this issue Apr 26, 2014 · 0 comments
Labels
needs_testing support wontfix_talk_to_redhat Red Hat has decided to replace this utility with a framework

Comments

@andriokha
Copy link

Hi,

Many thanks for dstat, I've found it very useful for ad-hoc monitoring. I've been struggling with what seemed like weird results, and I think I've found the problem.

$ dstat -ms --output out.csv 1 5

stdout:

------memory-usage----- ----swap---
 used  free  buff  cach| used  free
3955M  891M 2777M 48.6M|   0  4094M
3955M  891M 2777M 48.6M|   0  4094M
3955M  891M 2777M 48.6M|   0  4094M
3955M  891M 2777M 48.6M|   0  4094M
3955M  891M 2777M 48.6M|   0  4094M

out.csv

"Cmdline:","dstat -ms --output temp.csv 1 5",,,,"Date:","26 Apr 2014 14:28:19 BST"
"memory usage",,,,"swap",
"used","free","buff","cach","used","free"
4146851840,934621184,2911694848,50966528,306008064,77385728,20946944,0,4292866048
4146851840,934621184,2911694848,50966528,306008064,77385728,20946944,0,4292866048
4146851840,934629376,2911686656,50974720,305999872,77385728,20946944,0,4292866048
4146851840,934629376,2911686656,50974720,305999872,77385728,20946944,0,4292866048
4146851840,934617088,2911686656,50974720,306008064,77385728,20951040,0,4292866048

Note that although there are only 6 header fields, there are 9 fields of raw data. Taking a quick look at dstat_mem

self.nick = ('used', 'free', 'buff', 'cach')
self.vars = ('MemTotal', 'MemUsed', 'MemFree', 'Buffers', 'Cached', 'Shmem', 'SReclaimable')

it seems that the CSV gets every variable defined (7 of them) but the headers are based on the number of nicks. This means the labels are out of sync for every field coming after memory.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs_testing support wontfix_talk_to_redhat Red Hat has decided to replace this utility with a framework
Projects
None yet
Development

No branches or pull requests

2 participants