mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::fs::aio: Add specific read and write stat counters.
This commit is contained in:
parent
a70d65f171
commit
67772facef
3 changed files with 22 additions and 4 deletions
|
@ -49,11 +49,16 @@ struct ircd::fs::aio::stats
|
|||
uint64_t events {0}; ///< count of events from io_getevents
|
||||
uint64_t cancel {0}; ///< count of requests canceled
|
||||
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 complete_bytes {0}; ///< total bytes for requests completed
|
||||
uint64_t errors_bytes {0}; ///< total bytes for completed w/ errc
|
||||
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
|
||||
|
|
|
@ -125,6 +125,8 @@ ircd::fs::aio::read(const fd &fd,
|
|||
const_cast<const char *>(data(buf)), bytes
|
||||
};
|
||||
|
||||
aio::stats.read_bytes += bytes;
|
||||
aio::stats.reads++;
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -175,7 +177,8 @@ ircd::fs::aio::write(const fd &fd,
|
|||
|
||||
// Does linux ever not complete all bytes for an AIO?
|
||||
assert(size(view) == size(buf));
|
||||
|
||||
aio::stats.write_bytes += bytes;
|
||||
aio::stats.writes++;
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -755,9 +755,19 @@ console_cmd__aio(opt &out, const string_view &line)
|
|||
<< " " << pretty(iec(s.requests_bytes))
|
||||
<< std::endl;
|
||||
|
||||
out << std::setw(12) << std::left << "success"
|
||||
<< std::setw(9) << std::right << (s.complete - s.errors)
|
||||
<< " " << pretty(iec(s.complete_bytes - s.errors_bytes))
|
||||
out << std::setw(12) << std::left << "requests avg"
|
||||
<< std::setw(9) << std::right << " "
|
||||
<< " " << 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;
|
||||
|
||||
out << std::setw(12) << std::left << "errors"
|
||||
|
|
Loading…
Reference in a new issue