Kafka-14743: update request metrics after callback#13297
Merged
Conversation
Member
Author
|
@chia7712 , please take a look. Thanks. |
showuon
force-pushed
the
KAFKA-14743_2
branch
from
February 24, 2023 02:03
d6c98e5 to
7e7d2d3
Compare
divijvaidya
approved these changes
Feb 24, 2023
divijvaidya
left a comment
Member
There was a problem hiding this comment.
Minor nit comment. The change in itself looks good.
| } | ||
|
|
||
| def testV1Fetch(isFollowerFetch: Boolean): Unit = { | ||
| val fetchMessageConversionsTimeMsMetricName = s"$MessageConversionsTimeMs,request=Fetch" |
Member
There was a problem hiding this comment.
nit
Is it possible to generate this string with some constants? e.g. we can use RequestMetrics.MessageConversionsTimeMs
Member
Author
There was a problem hiding this comment.
Yes, we already used the constants from RequestMetrics.MessageConversionsTimeMs. It's just the fetch/produce request is another tag name that needed to be filtered out. Thanks.
chia7712
approved these changes
Feb 24, 2023
|
|
||
| TestUtils.waitUntilTrue(() => TestUtils.metersCount(fetchMessageConversionsTimeMsMetricName) > initialFetchMessageConversionsTimeMs, | ||
| s"The `MessageConversionsTimeMs` in fetch request metric count is not incremented after 5 seconds. " + | ||
| s"init: $initialFetchMessageConversionsTimeMs final: ${TestUtils.metersCount(fetchMessageConversionsTimeMsMetricName)}", 5000) |
Member
There was a problem hiding this comment.
Could you add tea for TemporaryMemoryBytes? It seems to me TemporaryMemoryBytes also get fixed by this patch .
Member
Author
|
Failed tests are unrelated: |
showuon
added a commit
that referenced
this pull request
Feb 26, 2023
Currently, the kafka.network:type=RequestMetrics,name=MessageConversionsTimeMs,request=Fetch will not get updated because the request metrics is recorded BEFORE the messageConversions metrics value updated. That means, even if we updated the messageConversions metrics value, the request metrics will never reflect the update. This patch fixes it by updating the request metric after callback completed, so that the messageConversions metric value can be updated correctly. Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Divij Vaidya <diviv@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, the
kafka.network:type=RequestMetrics,name=MessageConversionsTimeMs,request=Fetchwill not get updated because the request metrics is recorded BEFORE the messageConversions metrics value updated. That means, even if we updated themessageConversionsmetrics value, the request metrics will never reflect the update. This patch fixes it by updating the request metric after callback completed, so that themessageConversionsmetric value can be updated correctly.Committer Checklist (excluded from commit message)