Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC delay metrics #2293

Merged
merged 5 commits into from
Jul 3, 2024
Merged

RPC delay metrics #2293

merged 5 commits into from
Jul 3, 2024

Commits on Jun 25, 2024

  1. rpc: Fix hard-coded constants when sending unknown verb reply

    Ths code should stick to response_frame_headroom constant, not introduce
    magic numbers on its own.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    cf50944 View commit details
    Browse the repository at this point in the history
  2. rpc: Track handler execution time

    Note the time it took handler (server-side) callback to run and
    propagate it via optional argument down to .respond() method. Error
    handlers call respond() too, pass this argument disengaged in this case.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    dc42c7b View commit details
    Browse the repository at this point in the history
  3. rpc: Exchange handler duration with server responses

    Introduce new negotiation parameter that tells if the client wants
    server to send it back the handler execution duration. This is for
    compatibility with older clients that expect server reply to be of some
    fixed (shorter) size.
    
    New response frame, if negotiated, includes the 32 bit handler duration
    value in microseconds right next to the existing bits. If no duration
    was provided (sending error response, for example), the value is 0xF..F.
    After parsing, the duration is returned as optional value and 0xF..F
    maps to disengaged one.
    
    For now client makes no use of it, next patch will.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    5fc9acd View commit details
    Browse the repository at this point in the history
  4. rpc: Calculate delay and export it via metrics

    Now the client has two durations using which it can estimate the
    rount-trip time of a packet -- the duration between sending request and
    receiving response and the time it too handler to execute on the server
    side. Difference is the delay value.
    
    Those values from different calls are accumulated in a client counter as
    well as the total number of delay samples received (errors and old
    servers don't send it). Metrics export both as counters, so one can rate
    it over time and monitor average delay.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    41ee6ee View commit details
    Browse the repository at this point in the history
  5. test,rpc: Extend simple ping-pong case

    By default RPC client uses new frames, that include handler execution
    time. Tune up one simple test to validate that legacy frames still work
    too.
    
    Signed-off-by: Pavel Emelyanov <[email protected]>
    xemul committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    595ae18 View commit details
    Browse the repository at this point in the history