compressor: don't increment not_compressed twice#10446
Closed
rgs1 wants to merge 1 commit intoenvoyproxy:masterfrom
Closed
compressor: don't increment not_compressed twice#10446rgs1 wants to merge 1 commit intoenvoyproxy:masterfrom
rgs1 wants to merge 1 commit intoenvoyproxy:masterfrom
Conversation
No need to increment this stat both on decodeHeaders() _and_ encodeHeaders(). Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
dio
approved these changes
Mar 18, 2020
| Http::TestResponseTrailerMapImpl trailers; | ||
| EXPECT_EQ(Http::FilterTrailersStatus::Continue, filter_->encodeTrailers(trailers)); | ||
| EXPECT_EQ(1, stats_.counter("test.test.not_compressed").value()); | ||
| EXPECT_EQ(0U, stats_.counter("test.test.compressed").value()); |
Member
There was a problem hiding this comment.
Sorry I'm confused. Isn't this still not_compressed?
| compressor_ = config_->makeCompressor(); | ||
| } else if (!skip_compression_) { | ||
| skip_compression_ = true; | ||
| config_->stats().not_compressed_.inc(); |
Member
There was a problem hiding this comment.
I don't think this actually gets incremented twice as in the other case skip_compression_ is true?
Member
Author
There was a problem hiding this comment.
Bah, you are right -- sorry :-(
Quick drive by diff while I was debugging something else. Sorry folks.
Member
Author
|
Closing since this is doing the right thing. |
Member
|
Sorry misread the logic 🤦🏽♂️ |
Member
Author
totally my bad, here's a better attempt hopefully: #10447 |
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.
No need to increment this stat both on decodeHeaders() and
encodeHeaders().
Signed-off-by: Raul Gutierrez Segales rgs@pinterest.com