Commit 7cfd562c authored by lu43jih's avatar lu43jih
Browse files

Now reading unsigned int64 instead of int64

parent 9a02c42f
......@@ -53,7 +53,7 @@ void GpfsmonSensorGroup::stop() {
}
void GpfsmonSensorGroup::read() {
reading_t reading;
ureading_t reading;
reading.timestamp = getTimestamp();
try {
std::string toparse;
......@@ -122,37 +122,37 @@ bool GpfsmonSensorGroup::parseLine(std::string &&toparse){
std::string::size_type bytewrite_pos = toparse.find(" _bw_ ");
if( bytereads_pos != std::string::npos && bytewrite_pos != std::string::npos){
_data[IOBYTESREAD] = std::stoll(toparse.substr(bytereads_pos + 5, bytewrite_pos - bytereads_pos));
_data[IOBYTESREAD] = std::stoull(toparse.substr(bytereads_pos + 5, bytewrite_pos - bytereads_pos));
} else {
return false;
}
std::string::size_type opens_pos = toparse.find(" _oc_ ");
if( opens_pos != std::string::npos ){
_data[IOBYTESWRITE] = std::stoll(toparse.substr(bytewrite_pos + 6, opens_pos - bytewrite_pos));
_data[IOBYTESWRITE] = std::stoull(toparse.substr(bytewrite_pos + 6, opens_pos - bytewrite_pos));
} else {
return false;
}
std::string::size_type closes_pos = toparse.find(" _cc_ ");
if( closes_pos != std::string::npos){
_data[IOOPENS] = std::stoll(toparse.substr(opens_pos + 6, closes_pos - opens_pos));
_data[IOOPENS] = std::stoull(toparse.substr(opens_pos + 6, closes_pos - opens_pos));
} else {
return false;
}
std::string::size_type reads_pos = toparse.find(" _rdc_ ");
if( reads_pos != std::string::npos ){
_data[IOCLOSES] = std::stoll(toparse.substr(closes_pos + 6, reads_pos - closes_pos));
_data[IOCLOSES] = std::stoull(toparse.substr(closes_pos + 6, reads_pos - closes_pos));
} else {
return false;
}
std::string::size_type writes_pos = toparse.find(" _wc_ ");
if( writes_pos != std::string::npos ){
_data[IOREADS] = std::stoll(toparse.substr(reads_pos + 7, writes_pos - reads_pos));
_data[IOREADS] = std::stoull(toparse.substr(reads_pos + 7, writes_pos - reads_pos));
} else {
return false;
}
std::string::size_type dir_pos = toparse.find(" _dir_");
if( dir_pos != std::string::npos ){
_data[IOWRITES] = std::stoll(toparse.substr(writes_pos + 6, dir_pos - writes_pos));
_data[IOWRITES] = std::stoull(toparse.substr(writes_pos + 6, dir_pos - writes_pos));
} else {
return false;
}
......
......@@ -36,7 +36,7 @@ private:
const std::string _cmd_io = "/usr/lpp/mmfs/bin/mmpmon -p -i /tmp/gpfsmon"; //todo change to real command
std::vector<int64_t> _data; //!< temp variable in parseLine defined here for efficiency.
std::vector<uint64_t> _data; //!< temp variable in parseLine defined here for efficiency.
constexpr static int BUFFER_SIZE=255; //!< constant buffer that is used to parse line by line (from popen)
char const * TMP_GPFSMON="/tmp/gpfsmon";
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment