RATIS-2486. Add detailed zero-copy metrics for gRPC message types and fallback tracking. by slfan1989 · Pull Request #1417 · apache/ratis

What changes were proposed in this pull request?

This PR enhances ZeroCopyMetrics with detailed observability for gRPC zero-copy message processing:

  1. Per-message-type counters: Added separate metrics to track zero-copy usage for AppendEntries, InstallSnapshot, and ClientRequest messages
  2. Performance metrics: Added bytes_saved_by_zero_copy and zero_copy_parse_time_nanos to quantify zero-copy benefits
  3. Fallback diagnostics: Added counters for each fallback reason (not_known_length, not_detachable, not_byte_buffer) to help diagnose zero-copy compatibility issues
  4. InstallSnapshot support: Extended zero-copy marshalling to InstallSnapshot requests in GrpcServerProtocolService

What is the link to the Apache JIRA

RATIS-2486. Add detailed zero-copy metrics for gRPC message types and fallback tracking.

How was this patch tested?

  • Existing unit tests pass