Skip to content

Commit

Permalink
Minor clean up of variables (#67)
Browse files Browse the repository at this point in the history
Remove the unused static const variables from iomon (legacy of old
io reader) and move the defiition of the default parameter set to
utils.h for consistency.
  • Loading branch information
graeme-a-stewart authored and amete committed Jun 7, 2018
1 parent 99281bd commit c45c672
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 1 addition & 7 deletions package/src/iomon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@
#include <iostream>
#include <sstream>

const static std::vector<std::string> default_io_params{
"rchar", "wchar", "read_bytes", "write_bytes"};

const static unsigned int fname_size{64};
const static unsigned int line_buf_size{256};

// Constructor; uses RAII pattern to be valid
// after construction
iomon::iomon() : io_stats{} {
for (const auto& io_param : default_io_params) io_stats[io_param] = 0;
for (const auto& io_param : prmon::default_io_params) io_stats[io_param] = 0;
}

void iomon::update_stats(const std::vector<pid_t>& pids) {
Expand Down
2 changes: 2 additions & 0 deletions package/src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace prmon {
"rx_bytes", "rx_packets", "tx_bytes", "tx_packets"};
const static std::vector<std::string> default_wall_params{"wtime"};
const static std::vector<std::string> default_memory_params{"vmem", "pss", "rss", "swap"};
const static std::vector<std::string> default_io_params{
"rchar", "wchar", "read_bytes", "write_bytes"};
}

#endif // PRMON_UTILS_H

0 comments on commit c45c672

Please sign in to comment.