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

Record IO MiB read/write to client resource usage records #275

Open
wants to merge 43 commits into
base: master
Choose a base branch
from

Conversation

tsehori
Copy link
Contributor

@tsehori tsehori commented Aug 12, 2020

The table client_resource_usage_records in Fleetspeak's database (MySQL, SQLite) contains many important details about a Fleetspeak client such as mean_user_cpu_rate, mean_system_cpu_rate, max_resident_memory_mib etc.
We'd like to amend this table with a few more resource usage records. In this PR, I want to add IO bytes read/write, recorded using gopsutil.

Note that I'm using gopsutil instead of reading directly off of /proc/[pid]/io as the rest of the unix code suggets (for example, like the way resident memory is recorded), as it seems that gopsutil can do it too with Linux distributions (look up io_counters in the docs).

One thing to note is that this PR is not complete and not ready to be merged, as it lacks tests, which I'm unsure at the moment of how to conduct regarding IO usage.
I'm also open for discussions and arguments regarding the code itself; I've used similar code to the one that records resident memory, as it seems the most fitting to the IO usage scenario.

Gilad Tsehori added 30 commits August 3, 2020 14:07
Added all relevant SQL statements and pieces for ClientIOWrite, so the
columns MaxIoWriteMib and MeanIoWriteMib are added to the SQL database.
Changed the existing format of (mean|max)_io_(read|write)_mib to format
(mean|max)_io_(read|write) in order to be consistent with memory field.
@tsehori tsehori changed the title Record IO bytes read/write to client resource usage records Record IO MiB read/write to client resource usage records Sep 23, 2020
@tsehori tsehori marked this pull request as ready for review September 23, 2020 08:45
Gilad Tsehori added 7 commits September 23, 2020 11:59
IORead to IOReadBytes and IOWrite to IOWriteBytes.
All the newly added aggregated RUD fields, MeanIoRead, MaxIoRead,
MeanIoWrite, MaxIoWrite, were in MiB (similar to
Mean/MaxResidentMemory). Those are now changed to KiB instead of MiB.
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

Successfully merging this pull request may close these issues.

2 participants