0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

ircd::fs::aio: Add specific read and write stat counters.

This commit is contained in:
Jason Volk 2018-11-28 15:01:00 -08:00
parent a70d65f171
commit 67772facef
3 changed files with 22 additions and 4 deletions

View file

@ -49,11 +49,16 @@ struct ircd::fs::aio::stats
uint64_t events {0}; ///< count of events from io_getevents uint64_t events {0}; ///< count of events from io_getevents
uint64_t cancel {0}; ///< count of requests canceled uint64_t cancel {0}; ///< count of requests canceled
uint64_t errors {0}; ///< count of response errcodes uint64_t errors {0}; ///< count of response errcodes
uint64_t reads {0}; ///< count of read complete
uint64_t writes {0}; ///< count of write complete
uint64_t requests_bytes {0}; ///< total bytes for requests created uint64_t requests_bytes {0}; ///< total bytes for requests created
uint64_t complete_bytes {0}; ///< total bytes for requests completed uint64_t complete_bytes {0}; ///< total bytes for requests completed
uint64_t errors_bytes {0}; ///< total bytes for completed w/ errc uint64_t errors_bytes {0}; ///< total bytes for completed w/ errc
uint64_t cancel_bytes {0}; ///< total bytes for cancels uint64_t cancel_bytes {0}; ///< total bytes for cancels
uint64_t read_bytes {0}; ///< total bytes for read completed
uint64_t write_bytes {0}; ///< total bytes for write completed
}; };
struct ircd::fs::aio::init struct ircd::fs::aio::init

View file

@ -125,6 +125,8 @@ ircd::fs::aio::read(const fd &fd,
const_cast<const char *>(data(buf)), bytes const_cast<const char *>(data(buf)), bytes
}; };
aio::stats.read_bytes += bytes;
aio::stats.reads++;
return view; return view;
} }
@ -175,7 +177,8 @@ ircd::fs::aio::write(const fd &fd,
// Does linux ever not complete all bytes for an AIO? // Does linux ever not complete all bytes for an AIO?
assert(size(view) == size(buf)); assert(size(view) == size(buf));
aio::stats.write_bytes += bytes;
aio::stats.writes++;
return view; return view;
} }

View file

@ -755,9 +755,19 @@ console_cmd__aio(opt &out, const string_view &line)
<< " " << pretty(iec(s.requests_bytes)) << " " << pretty(iec(s.requests_bytes))
<< std::endl; << std::endl;
out << std::setw(12) << std::left << "success" out << std::setw(12) << std::left << "requests avg"
<< std::setw(9) << std::right << (s.complete - s.errors) << std::setw(9) << std::right << " "
<< " " << pretty(iec(s.complete_bytes - s.errors_bytes)) << " " << pretty(iec(s.requests_bytes / s.requests))
<< std::endl;
out << std::setw(12) << std::left << "reads"
<< std::setw(9) << std::right << s.reads
<< " " << pretty(iec(s.read_bytes))
<< std::endl;
out << std::setw(12) << std::left << "writes"
<< std::setw(9) << std::right << s.writes
<< " " << pretty(iec(s.write_bytes))
<< std::endl; << std::endl;
out << std::setw(12) << std::left << "errors" out << std::setw(12) << std::left << "errors"