diff --git a/src/server/server_family.cc b/src/server/server_family.cc index adbb09b36a9f..762f8ed12e8e 100644 --- a/src/server/server_family.cc +++ b/src/server/server_family.cc @@ -1073,6 +1073,8 @@ void PrintPrometheusMetrics(const Metrics& m, DflyCmd* dfly_cmd, StringResponse* MetricType::GAUGE, &resp->body()); AppendMetricWithoutLabels("dispatch_queue_bytes", "", conn_stats.dispatch_queue_bytes, MetricType::GAUGE, &resp->body()); + AppendMetricWithoutLabels("pipeline_cmd_cache_bytes", "", conn_stats.pipeline_cmd_cache_bytes, + MetricType::GAUGE, &resp->body()); // Memory metrics auto sdata_res = io::ReadStatusInfo(); @@ -1107,6 +1109,8 @@ void PrintPrometheusMetrics(const Metrics& m, DflyCmd* dfly_cmd, StringResponse* << sdata_res.error().message(); } AppendMetricWithoutLabels("tls_bytes", "", m.tls_bytes, MetricType::GAUGE, &resp->body()); + AppendMetricWithoutLabels("snapshot_serialization_bytes", "", m.serialization_bytes, + MetricType::GAUGE, &resp->body()); DbStats total; for (const auto& db_stats : m.db_stats) { @@ -1867,6 +1871,7 @@ Metrics ServerFamily::GetMetrics() const { result.uptime = time(NULL) - this->start_time_; result.qps += uint64_t(ss->MovingSum6()); result.facade_stats += *tl_facade_stats; + result.serialization_bytes += SliceSnapshot::GetThreadLocalMemoryUsage(); if (shard) { result.heap_used_bytes += shard->UsedMemory(); @@ -2022,6 +2027,7 @@ void ServerFamily::Info(CmdArgList args, ConnectionContext* cntx) { append("dispatch_queue_peak_bytes", m.peak_stats.conn_dispatch_queue_bytes); append("client_read_buffer_peak_bytes", m.peak_stats.conn_read_buf_capacity); append("tls_bytes", m.tls_bytes); + append("snapshot_serialization_bytes", m.serialization_bytes); if (GetFlag(FLAGS_cache_mode)) { append("cache_mode", "cache"); diff --git a/src/server/server_family.h b/src/server/server_family.h index 2f8a151c8393..021812d9ce51 100644 --- a/src/server/server_family.h +++ b/src/server/server_family.h @@ -97,6 +97,7 @@ struct Metrics { uint64_t fiber_switch_delay_usec = 0; uint64_t tls_bytes = 0; uint64_t refused_conn_max_clients_reached_count = 0; + uint64_t serialization_bytes = 0; // Statistics about fibers running for a long time (more than 1ms). uint64_t fiber_longrun_cnt = 0;