valkey-io / valkey

A flexible distributed key-value datastore that supports both caching and beyond caching workloads.
https://valkey.io
Other
15.49k stars 570 forks source link

[NEW] Introduce server level network ingress / egress metrics for cluster bus. #828

Open kyle-yh-kim opened 1 month ago

kyle-yh-kim commented 1 month ago

The problem/use-case that the feature addresses Valkey server already accumulates the following networking server statistics;

// server.h
long long stat_net_input_bytes;                /* Bytes read from network. */
long long stat_net_output_bytes;               /* Bytes written to network. */
long long stat_net_repl_input_bytes; /* Bytes read during replication, added to stat_net_input_bytes in 'info'. */
/* Bytes written during replication, added to stat_net_output_bytes in 'info'. */
long long stat_net_repl_output_bytes;

I propose the following statistics for all cluster bus operations. Primary hook-point could be upon processClusterPacket().

long long stat_net_clusterbus_input_bytes;                /* Bytes read from network. */
long long stat_net_clusterbus_output_bytes;               /* Bytes written to network. */

Description of the feature

A description of what you want to happen.

Alternatives you've considered

Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.

Additional information

Any additional information that is relevant to the feature request.

zuiderkwast commented 1 month ago

Do you want to show them in INFO, under network or under cluster? What to show for non-cluster mode? (Zero or omit the fields?)

Shall we store these fields under server->cluster so they only exist in cluster mode?