提交 a275e9f5 编写于 作者: Q qinzuoyan

add pref counter recent.abnormal.counter

Summary: Ref T10570

Test Plan: N/A

Reviewers: sunweijie, cailiuyang, laiyingchun, heyuchen, wutao1

Reviewed By: cailiuyang

Subscribers: #pegasus

Maniphest Tasks: T10570

Differential Revision: https://phabricator.d.xiaomi.net/D89568
上级 1e0c02d0
......@@ -104,6 +104,7 @@ void info_collector::on_app_stat()
counters->scan_qps->set(row.scan_qps);
counters->recent_expire_count->set(row.recent_expire_count);
counters->recent_filter_count->set(row.recent_filter_count);
counters->recent_abnormal_count->set(row.recent_abnormal_count);
counters->storage_mb->set(row.storage_mb);
counters->storage_count->set(row.storage_count);
counters->read_qps->set(read_qps[i]);
......@@ -144,6 +145,7 @@ info_collector::AppStatCounters *info_collector::get_app_counters(const std::str
INIT_COUNER(scan_qps);
INIT_COUNER(recent_expire_count);
INIT_COUNER(recent_filter_count);
INIT_COUNER(recent_abnormal_count);
INIT_COUNER(storage_mb);
INIT_COUNER(storage_count);
INIT_COUNER(read_qps);
......
......@@ -37,6 +37,7 @@ public:
::dsn::perf_counter_wrapper scan_qps;
::dsn::perf_counter_wrapper recent_expire_count;
::dsn::perf_counter_wrapper recent_filter_count;
::dsn::perf_counter_wrapper recent_abnormal_count;
::dsn::perf_counter_wrapper storage_mb;
::dsn::perf_counter_wrapper storage_count;
::dsn::perf_counter_wrapper read_qps;
......
......@@ -286,6 +286,12 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
COUNTER_TYPE_VOLATILE_NUMBER,
"statistic the recent filtered value read count");
snprintf(buf, 255, "recent.abnormal.count@%s", str_gpid);
_pfc_recent_abnormal_count.init_app_counter("app.pegasus",
buf,
COUNTER_TYPE_VOLATILE_NUMBER,
"statistic the recent abnormal read count");
snprintf(buf, 255, "disk.storage.sst.count@%s", str_gpid);
_pfc_sst_count.init_app_counter(
"app.pegasus", buf, COUNTER_TYPE_NUMBER, "statistic the count of sstable files");
......@@ -793,6 +799,7 @@ void pegasus_server_impl::on_get(const ::dsn::blob &key,
status.ToString().c_str(),
(int)value->size(),
time_used);
_pfc_recent_abnormal_count->increment();
}
}
......@@ -1140,6 +1147,7 @@ void pegasus_server_impl::on_multi_get(const ::dsn::apps::multi_get_request &req
expire_count,
filter_count,
time_used);
_pfc_recent_abnormal_count->increment();
}
}
......
......@@ -248,6 +248,7 @@ private:
::dsn::perf_counter_wrapper _pfc_recent_expire_count;
::dsn::perf_counter_wrapper _pfc_recent_filter_count;
::dsn::perf_counter_wrapper _pfc_recent_abnormal_count;
::dsn::perf_counter_wrapper _pfc_sst_count;
::dsn::perf_counter_wrapper _pfc_sst_size;
};
......
......@@ -338,6 +338,7 @@ struct row_data
double scan_qps;
double recent_expire_count;
double recent_filter_count;
double recent_abnormal_count;
double storage_mb;
double storage_count;
row_data()
......@@ -350,6 +351,7 @@ struct row_data
scan_qps(0),
recent_expire_count(0),
recent_filter_count(0),
recent_abnormal_count(0),
storage_mb(0),
storage_count(0)
{
......@@ -376,6 +378,8 @@ update_app_pegasus_perf_counter(row_data &row, const std::string &counter_name,
row.recent_expire_count += value;
else if (counter_name == "recent.filter.count")
row.recent_filter_count += value;
else if (counter_name == "recent.abnormal.count")
row.recent_abnormal_count += value;
else if (counter_name == "disk.storage.sst(MB)")
row.storage_mb += value;
else if (counter_name == "disk.storage.sst.count")
......
......@@ -3164,7 +3164,8 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)
<< std::setw(15) << std::right << "REMOVE" << std::setw(15) << std::right << "MULTI_REMOVE"
<< std::setw(15) << std::right << "SCAN" << std::setw(15) << std::right << "expire_count"
<< std::setw(15) << std::right << "filter_count" << std::setw(15) << std::right
<< "storage(MB)" << std::setw(15) << std::right << "sst_count" << std::endl;
<< "abmornal_count" << std::setw(15) << std::right << "storage(MB)" << std::setw(15)
<< std::right << "sst_count" << std::endl;
rows.resize(rows.size() + 1);
row_data &sum = rows.back();
for (int i = 0; i < rows.size() - 1; ++i) {
......@@ -3178,6 +3179,7 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)
sum.scan_qps += row.scan_qps;
sum.recent_expire_count += row.recent_expire_count;
sum.recent_filter_count += row.recent_filter_count;
sum.recent_abnormal_count += row.recent_abnormal_count;
sum.storage_mb += row.storage_mb;
sum.storage_count += row.storage_count;
}
......@@ -3200,6 +3202,7 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)
PRINT_QPS(scan_qps);
out << std::setw(15) << std::right << (int64_t)row.recent_expire_count << std::setw(15)
<< std::right << (int64_t)row.recent_filter_count << std::setw(15) << std::right
<< (int64_t)row.recent_abnormal_count << std::setw(15) << std::right
<< (int64_t)row.storage_mb << std::setw(15) << std::right << (int64_t)row.storage_count
<< std::endl;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册