void Cache::register_metrics()
{
+ stats = {};
+
namespace sm = seastar::metrics;
using src_t = Transaction::src_t;
/*
* trans_created
*/
- stats.trans_created_by_src.fill(0);
for (auto& [src, src_label] : labels_by_src) {
metrics.add_group(
"cache",
/*
* trans_committed
*/
- stats.trans_committed_by_src.fill(0);
for (auto& [src, src_label] : labels_by_src) {
if (src == src_t::READ) {
// READ transaction won't commit
for (auto& [ext, ext_label] : labels_by_ext) {
auto& counter_by_extent = get_by_src(stats.trans_invalidated, src);
auto& counter = get_by_ext(counter_by_extent, ext);
- counter = 0;
metrics.add_group(
"cache",
{
/**
* trans_read_successful
*/
- stats.read_transactions_successful = 0;
metrics.add_group(
"cache",
{
/*
* cache_query: cache_access and cache_hit
*/
- stats.cache_query_by_src.fill({});
for (auto& [src, src_label] : labels_by_src) {
metrics.add_group(
"cache",
continue;
}
auto& efforts = get_by_src(stats.invalidated_efforts_by_src, src);
- efforts = {};
for (auto& effort_name : effort_names) {
auto& effort = [&effort_name, &efforts]() -> effort_t& {
if (effort_name == "READ") {
auto read_src_label = labels_by_src.find(src_t::READ)->second;
auto read_effort_label = effort_label("READ");
auto& read_efforts = get_by_src(stats.invalidated_efforts_by_src, src_t::READ);
- read_efforts = {};
metrics.add_group(
"cache",
{
return efforts.fresh_by_ext;
}
}();
- effort_by_ext.fill({});
for (auto& [ext, ext_label] : labels_by_ext) {
auto& effort = get_by_ext(effort_by_ext, ext);
metrics.add_group(
} // effort_name
auto& delta_by_ext = efforts.delta_bytes_by_ext;
- delta_by_ext.fill(0);
for (auto& [ext, ext_label] : labels_by_ext) {
auto& value = get_by_ext(delta_by_ext, ext);
metrics.add_group(
/**
* read_effort_successful
*/
- stats.read_effort_successful = {};
metrics.add_group(
"cache",
{
*
* Dirty extents
*/
- stats.dirty_bytes = 0;
metrics.add_group(
"cache",
{
uint64_t& tree_depth,
counter_by_src_t<tree_efforts_t>& committed_tree_efforts,
counter_by_src_t<tree_efforts_t>& invalidated_tree_efforts) {
- tree_depth = 0;
metrics.add_group(
"cache",
{
),
}
);
- committed_tree_efforts.fill({});
- invalidated_tree_efforts.fill({});
for (auto& [src, src_label] : labels_by_src) {
if (src == src_t::READ) {
// READ transaction won't contain any tree inserts and erases
counter_by_src_t<counter_by_extent_t<uint64_t>> trans_invalidated;
counter_by_src_t<trans_efforts_t> invalidated_efforts_by_src;
counter_by_src_t<query_counters_t> cache_query_by_src;
- uint64_t read_transactions_successful;
+ uint64_t read_transactions_successful = 0;
effort_t read_effort_successful;
- uint64_t dirty_bytes;
+ uint64_t dirty_bytes = 0;
- uint64_t onode_tree_depth;
+ uint64_t onode_tree_depth = 0;
counter_by_src_t<tree_efforts_t> committed_onode_tree_efforts;
counter_by_src_t<tree_efforts_t> invalidated_onode_tree_efforts;
- uint64_t lba_tree_depth;
+ uint64_t lba_tree_depth = 0;
counter_by_src_t<tree_efforts_t> committed_lba_tree_efforts;
counter_by_src_t<tree_efforts_t> invalidated_lba_tree_efforts;
} stats;