Skip to content

Commit

Permalink
Support cpu_write_nanos and cpu_read_nanos in IOStatsContext (faceboo…
Browse files Browse the repository at this point in the history
…k#8149)

Summary: Pull Request resolved: facebook#8149

Reviewed By: ajkr

Differential Revision: D27571017

Pulled By: riversand963

fbshipit-source-id: a73427e907a7cb899debf55d60a2ede726695277
  • Loading branch information
darionyaphet authored and facebook-github-bot committed Apr 6, 2021
1 parent 88c8f7a commit b2c48a5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions monitoring/iostats_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ void IOStatsContext::Reset() {
prepare_write_nanos = 0;
fsync_nanos = 0;
logger_nanos = 0;
cpu_write_nanos = 0;
cpu_read_nanos = 0;
}

#define IOSTATS_CONTEXT_OUTPUT(counter) \
Expand All @@ -53,6 +55,8 @@ std::string IOStatsContext::ToString(bool exclude_zero_counters) const {
IOSTATS_CONTEXT_OUTPUT(fsync_nanos);
IOSTATS_CONTEXT_OUTPUT(prepare_write_nanos);
IOSTATS_CONTEXT_OUTPUT(logger_nanos);
IOSTATS_CONTEXT_OUTPUT(cpu_write_nanos);
IOSTATS_CONTEXT_OUTPUT(cpu_read_nanos);

std::string str = ss.str();
str.erase(str.find_last_not_of(", ") + 1);
Expand Down

0 comments on commit b2c48a5

Please sign in to comment.