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

feat: Add metrics for pull query request/response size in bytes #6148

Merged
merged 7 commits into from
Sep 28, 2020

Conversation

vpapavas
Copy link
Member

@vpapavas vpapavas commented Sep 3, 2020

Description

Add metrics for pull query request/response size in bytes. I added it only to the StreamedQueryResource and not the WSQueryEndpoint since in the latter I don't have access to the vertx objects to measure their size. Also, it's not important to measure the size for queries issued from the UI editor.

Testing done

Local testing with issuing pull queries and checking the value of the metrics

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@vpapavas vpapavas requested a review from a team as a code owner September 3, 2020 01:35
@@ -112,6 +118,9 @@ static void handleOldApiResponse(final Server server, final RoutingContext routi
response.end(responseBody);
}
}
pullQueryMetrics
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where we have access to the response sent over the wire. That's why I had to pass the pullQueryMetrics object in here

//Record latency at microsecond scale
final long nowNanos = Time.SYSTEM.nanoseconds();
final double latency = TimeUnit.NANOSECONDS.toMicros(nowNanos - startTimeNanos);
pullQueryMetrics.get().recordLatency(latency);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not measuring the request/response here since I don't have access to the HttpServerRequest/HttpServerResponse objects here

Copy link
Member

@AlanConfluent AlanConfluent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few last comments.

@vpapavas vpapavas merged commit 946d2d3 into confluentinc:master Sep 28, 2020
@vpapavas vpapavas deleted the size-metrics branch January 26, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants