Unverified Commit f5585834 authored by DarrenJiang13's avatar DarrenJiang13 Committed by GitHub
Browse files

Split instantaneous_repl_total_kbps to instantaneous_input_repl_kbps and...

Split instantaneous_repl_total_kbps to instantaneous_input_repl_kbps and instantaneous_output_repl_kbps. (#10810)

A supplement to https://github.com/redis/redis/pull/10062
Split `instantaneous_repl_total_kbps` to `instantaneous_input_repl_kbps` and `instantaneous_output_repl_kbps`. 
## Work:
This PR:
- delete 1 info field:
    - `instantaneous_repl_total_kbps`
- add 2 info fields:
    - `instantaneous_input_repl_kbps / instantaneous_output_repl_kbps`
## Result:
- master
```
total_net_input_bytes:26633673
total_net_output_bytes:21716596
total_net_repl_input_bytes:0
total_net_repl_output_bytes:18433052
instantaneous_input_kbps:0.02
instantaneous_output_kbps:0.00
instantaneous_input_repl_kbps:0.00
instantaneous_output_repl_kbps:0.00
```
- slave
```
total_net_input_bytes:18433212
total_net_output_bytes:94790
total_net_repl_input_bytes:18433052
total_net_repl_output_bytes:0
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.05
instantaneous_input_repl_kbps:0.00
instantaneous_output_repl_kbps:0.00
```
parent c751d8a6
...@@ -1204,8 +1204,10 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { ...@@ -1204,8 +1204,10 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
stat_net_input_bytes + stat_net_repl_input_bytes); stat_net_input_bytes + stat_net_repl_input_bytes);
trackInstantaneousMetric(STATS_METRIC_NET_OUTPUT, trackInstantaneousMetric(STATS_METRIC_NET_OUTPUT,
stat_net_output_bytes + stat_net_repl_output_bytes); stat_net_output_bytes + stat_net_repl_output_bytes);
trackInstantaneousMetric(STATS_METRIC_NET_TOTAL_REPLICATION, trackInstantaneousMetric(STATS_METRIC_NET_INPUT_REPLICATION,
stat_net_repl_input_bytes + stat_net_repl_output_bytes); stat_net_repl_input_bytes);
trackInstantaneousMetric(STATS_METRIC_NET_OUTPUT_REPLICATION,
stat_net_repl_output_bytes);
} }
/* We have just LRU_BITS bits per object for LRU information. /* We have just LRU_BITS bits per object for LRU information.
...@@ -5622,7 +5624,8 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { ...@@ -5622,7 +5624,8 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
"total_net_repl_output_bytes:%lld\r\n" "total_net_repl_output_bytes:%lld\r\n"
"instantaneous_input_kbps:%.2f\r\n" "instantaneous_input_kbps:%.2f\r\n"
"instantaneous_output_kbps:%.2f\r\n" "instantaneous_output_kbps:%.2f\r\n"
"instantaneous_repl_total_kbps:%.2f\r\n" "instantaneous_input_repl_kbps:%.2f\r\n"
"instantaneous_output_repl_kbps:%.2f\r\n"
"rejected_connections:%lld\r\n" "rejected_connections:%lld\r\n"
"sync_full:%lld\r\n" "sync_full:%lld\r\n"
"sync_partial_ok:%lld\r\n" "sync_partial_ok:%lld\r\n"
...@@ -5670,7 +5673,8 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) { ...@@ -5670,7 +5673,8 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
stat_net_repl_output_bytes, stat_net_repl_output_bytes,
(float)getInstantaneousMetric(STATS_METRIC_NET_INPUT)/1024, (float)getInstantaneousMetric(STATS_METRIC_NET_INPUT)/1024,
(float)getInstantaneousMetric(STATS_METRIC_NET_OUTPUT)/1024, (float)getInstantaneousMetric(STATS_METRIC_NET_OUTPUT)/1024,
(float)getInstantaneousMetric(STATS_METRIC_NET_TOTAL_REPLICATION)/1024, (float)getInstantaneousMetric(STATS_METRIC_NET_INPUT_REPLICATION)/1024,
(float)getInstantaneousMetric(STATS_METRIC_NET_OUTPUT_REPLICATION)/1024,
server.stat_rejected_conn, server.stat_rejected_conn,
server.stat_sync_full, server.stat_sync_full,
server.stat_sync_partial_ok, server.stat_sync_partial_ok,
......
...@@ -156,8 +156,9 @@ typedef long long ustime_t; /* microsecond time type. */ ...@@ -156,8 +156,9 @@ typedef long long ustime_t; /* microsecond time type. */
#define STATS_METRIC_COMMAND 0 /* Number of commands executed. */ #define STATS_METRIC_COMMAND 0 /* Number of commands executed. */
#define STATS_METRIC_NET_INPUT 1 /* Bytes read to network. */ #define STATS_METRIC_NET_INPUT 1 /* Bytes read to network. */
#define STATS_METRIC_NET_OUTPUT 2 /* Bytes written to network. */ #define STATS_METRIC_NET_OUTPUT 2 /* Bytes written to network. */
#define STATS_METRIC_NET_TOTAL_REPLICATION 3 /* Bytes written and read to network during replication. */ #define STATS_METRIC_NET_INPUT_REPLICATION 3 /* Bytes read to network during replication. */
#define STATS_METRIC_COUNT 4 #define STATS_METRIC_NET_OUTPUT_REPLICATION 4 /* Bytes written to network during replication. */
#define STATS_METRIC_COUNT 5
/* Protocol and I/O related defines */ /* Protocol and I/O related defines */
#define PROTO_IOBUF_LEN (1024*16) /* Generic I/O buffer size */ #define PROTO_IOBUF_LEN (1024*16) /* Generic I/O buffer size */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment