mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
chore: add oom stats to /metrics (#2680)
* chore: add oom stats to /metrics Expose oom/cmd errors when we reject executing a command if we reached OOM state (controlled by oom_deny_ratio flag). Expose oom/insert errors when we do not insert a new key or do not grow a dashtable (controlled by table_growth_margin). Move OOM command check to a place that covers all types of transactions - including multi and squashing transactions. --------- Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
parent
7c443f3a15
commit
0c1150956b
4 changed files with 25 additions and 12 deletions
|
@ -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) == 14 * 8, "Stats size mismatch");
|
||||
static_assert(sizeof(Stats) == 15 * 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,7 @@ 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->oom_error_cmd_cnt += other.oom_error_cmd_cnt;
|
||||
|
||||
if (this->tx_width_freq_arr.size() > 0) {
|
||||
DCHECK_EQ(this->tx_width_freq_arr.size(), other.tx_width_freq_arr.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue