feat(server): Add metric for RDB save duration. (#2768)

* feat(server): Add metric for RDB save duration.

This tracks both saving to RDB files, DFS files and full sync
replication.

* Add rdb_save_count
This commit is contained in:
Shahar Mike 2024-03-26 12:47:18 +02:00 committed by GitHub
parent 966d7f55ba
commit d8ce011749
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View file

@ -28,7 +28,7 @@ ServerState::Stats::Stats(unsigned num_shards) : tx_width_freq_arr(num_shards) {
}
ServerState::Stats& ServerState::Stats::Add(const ServerState::Stats& other) {
static_assert(sizeof(Stats) == 15 * 8, "Stats size mismatch");
static_assert(sizeof(Stats) == 17 * 8, "Stats size mismatch");
for (int i = 0; i < NUM_TX_TYPES; ++i) {
this->tx_type_cnt[i] += other.tx_type_cnt[i];
@ -44,6 +44,8 @@ ServerState::Stats& ServerState::Stats::Add(const ServerState::Stats& other) {
this->multi_squash_exec_reply_usec += other.multi_squash_exec_reply_usec;
this->blocked_on_interpreter += other.blocked_on_interpreter;
this->rdb_save_usec += other.rdb_save_usec;
this->rdb_save_count += other.rdb_save_count;
this->oom_error_cmd_cnt += other.oom_error_cmd_cnt;
if (this->tx_width_freq_arr.size() > 0) {