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

Fix recordCommandLatency to work properly #874

Closed

Conversation

jongyeol
Copy link
Contributor

@jongyeol jongyeol commented Oct 1, 2018

Make sure that:

  • You have read the contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

In previous commit f350431 , wrapped redisCommand was changed to command. And, recordCommandLatency() is not called properly in 5.1.0.RELEASE, because DefaultChannelPromise.isVoid() == false. This PR fixed it.

Here is a sample for user-side: https://gist.github.com/jongyeol/edd80cb080aaab1fa619c7001b0ccbed

@codecov
Copy link

codecov bot commented Oct 1, 2018

Codecov Report

Merging #874 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #874      +/-   ##
============================================
+ Coverage     81.04%   81.11%   +0.06%     
- Complexity     5674     5681       +7     
============================================
  Files           409      409              
  Lines         18364    18364              
  Branches       2125     2125              
============================================
+ Hits          14884    14896      +12     
+ Misses         2461     2459       -2     
+ Partials       1019     1009      -10
Impacted Files Coverage Δ Complexity Δ
.../java/io/lettuce/core/protocol/CommandHandler.java 78.26% <100%> (+1.35%) 105 <0> (+3) ⬆️
.../io/lettuce/core/dynamic/ReactiveTypeAdapters.java 83.1% <0%> (-0.68%) 1% <0%> (ø)
src/main/java/io/lettuce/core/RedisPublisher.java 79.92% <0%> (+0.37%) 5% <0%> (ø) ⬇️
...e/core/metrics/DefaultCommandLatencyCollector.java 77.5% <0%> (+4.16%) 22% <0%> (+1%) ⬆️
...java/io/lettuce/core/metrics/CommandLatencyId.java 70.73% <0%> (+4.87%) 10% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa4b044...f8911c6. Read the comment docs.

@mp911de mp911de added the type: bug A general bug label Oct 1, 2018
@mp911de
Copy link
Collaborator

mp911de commented Oct 1, 2018

Thanks a lot. Will include this fix in the next release.

mp911de pushed a commit that referenced this pull request Oct 2, 2018
CommandHandler.addToStack(…) now adds the wrapped (with latency decorator) command to the protocol stack that allows capturing of latency metrics again. Previously, the non-wrapped command was added to the protocol stack.
mp911de added a commit that referenced this pull request Oct 2, 2018
Add author tags.
mp911de pushed a commit that referenced this pull request Oct 2, 2018
CommandHandler.addToStack(…) now adds the wrapped (with latency decorator) command to the protocol stack that allows capturing of latency metrics again. Previously, the non-wrapped command was added to the protocol stack.
mp911de added a commit that referenced this pull request Oct 2, 2018
Add author tags.
@mp911de
Copy link
Collaborator

mp911de commented Oct 2, 2018

Thanks a lot. That's merged, polished, and backported now.

@mp911de mp911de closed this Oct 2, 2018
@mp911de mp911de added this to the 5.1.1 milestone Oct 2, 2018
@jongyeol jongyeol deleted the feature-fix-recordCommandLatency branch October 2, 2018 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants