@@ -1283,8 +1283,11 @@ void PrintPrometheusMetrics(uint64_t uptime, const Metrics& m, DflyCmd* dfly_cmd
1283
1283
const auto & conn_stats = m.facade_stats .conn_stats ;
1284
1284
AppendMetricWithoutLabels (" max_clients" , " Maximal number of clients" , GetFlag (FLAGS_maxclients),
1285
1285
MetricType::GAUGE, &resp->body ());
1286
- AppendMetricWithoutLabels (" connected_clients" , " " , conn_stats.num_conns , MetricType::GAUGE,
1287
- &resp->body ());
1286
+ AppendMetricHeader (" connected_clients" , " " , MetricType::GAUGE, &resp->body ());
1287
+ AppendMetricValue (" connected_clients" , conn_stats.num_conns_main , {" listener" }, {" main" },
1288
+ &resp->body ());
1289
+ AppendMetricValue (" connected_clients" , conn_stats.num_conns_other , {" listener" }, {" other" },
1290
+ &resp->body ());
1288
1291
AppendMetricWithoutLabels (" client_read_buffer_bytes" , " " , conn_stats.read_buf_capacity ,
1289
1292
MetricType::GAUGE, &resp->body ());
1290
1293
AppendMetricWithoutLabels (" blocked_clients" , " " , conn_stats.num_blocked_clients ,
@@ -1381,8 +1384,11 @@ void PrintPrometheusMetrics(uint64_t uptime, const Metrics& m, DflyCmd* dfly_cmd
1381
1384
AppendMetricWithoutLabels (" connections_received_total" , " " , conn_stats.conn_received_cnt ,
1382
1385
MetricType::COUNTER, &resp->body ());
1383
1386
1384
- AppendMetricWithoutLabels (" commands_processed_total" , " " , conn_stats.command_cnt ,
1385
- MetricType::COUNTER, &resp->body ());
1387
+ AppendMetricHeader (" commands_processed_total" , " " , MetricType::COUNTER, &resp->body ());
1388
+ AppendMetricValue (" commands_processed_total" , conn_stats.command_cnt_main , {" listener" }, {" main" },
1389
+ &resp->body ());
1390
+ AppendMetricValue (" commands_processed_total" , conn_stats.command_cnt_other , {" listener" },
1391
+ {" other" }, &resp->body ());
1386
1392
AppendMetricWithoutLabels (" keyspace_hits_total" , " " , m.events .hits , MetricType::COUNTER,
1387
1393
&resp->body ());
1388
1394
AppendMetricWithoutLabels (" keyspace_misses_total" , " " , m.events .misses , MetricType::COUNTER,
@@ -1628,6 +1634,8 @@ void ServerFamily::StatsMC(std::string_view section, SinkReplyBuilder* builder)
1628
1634
Metrics m = GetMetrics (&namespaces->GetDefaultNamespace ());
1629
1635
uint64_t uptime = time (NULL ) - start_time_;
1630
1636
1637
+ const uint32_t total_conns =
1638
+ m.facade_stats .conn_stats .num_conns_main + m.facade_stats .conn_stats .num_conns_other ;
1631
1639
ADD_LINE (pid, getpid ());
1632
1640
ADD_LINE (uptime, uptime);
1633
1641
ADD_LINE (time, now);
@@ -1637,7 +1645,7 @@ void ServerFamily::StatsMC(std::string_view section, SinkReplyBuilder* builder)
1637
1645
ADD_LINE (rusage_user, utime);
1638
1646
ADD_LINE (rusage_system, systime);
1639
1647
ADD_LINE (max_connections, -1 );
1640
- ADD_LINE (curr_connections, m. facade_stats . conn_stats . num_conns );
1648
+ ADD_LINE (curr_connections, total_conns );
1641
1649
ADD_LINE (total_connections, -1 );
1642
1650
ADD_LINE (rejected_connections, -1 );
1643
1651
ADD_LINE (bytes_read, m.facade_stats .conn_stats .io_read_bytes );
@@ -2357,7 +2365,8 @@ string ServerFamily::FormatInfoMetrics(const Metrics& m, std::string_view sectio
2357
2365
};
2358
2366
2359
2367
auto add_clients_info = [&] {
2360
- append (" connected_clients" , m.facade_stats .conn_stats .num_conns );
2368
+ append (" connected_clients" ,
2369
+ m.facade_stats .conn_stats .num_conns_main + m.facade_stats .conn_stats .num_conns_other );
2361
2370
append (" max_clients" , GetFlag (FLAGS_maxclients));
2362
2371
append (" client_read_buffer_bytes" , m.facade_stats .conn_stats .read_buf_capacity );
2363
2372
append (" blocked_clients" , m.facade_stats .conn_stats .num_blocked_clients );
@@ -2445,7 +2454,7 @@ string ServerFamily::FormatInfoMetrics(const Metrics& m, std::string_view sectio
2445
2454
auto & reply_stats = m.facade_stats .reply_stats ;
2446
2455
2447
2456
append (" total_connections_received" , conn_stats.conn_received_cnt );
2448
- append (" total_commands_processed" , conn_stats.command_cnt );
2457
+ append (" total_commands_processed" , conn_stats.command_cnt_main + conn_stats. command_cnt_other );
2449
2458
append (" instantaneous_ops_per_sec" , m.qps );
2450
2459
append (" total_pipelined_commands" , conn_stats.pipelined_cmd_cnt );
2451
2460
append (" total_pipelined_squashed_commands" , m.coordinator_stats .squashed_commands );
0 commit comments