Skip to content

compressor: don't increment not_compressed twice#10446

Closed
rgs1 wants to merge 1 commit intoenvoyproxy:masterfrom
rgs1:fix-compressor-filter
Closed

compressor: don't increment not_compressed twice#10446
rgs1 wants to merge 1 commit intoenvoyproxy:masterfrom
rgs1:fix-compressor-filter

Conversation

@rgs1
Copy link
Member

@rgs1 rgs1 commented Mar 18, 2020

No need to increment this stat both on decodeHeaders() and
encodeHeaders().

Signed-off-by: Raul Gutierrez Segales rgs@pinterest.com

No need to increment this stat both on decodeHeaders() _and_
encodeHeaders().

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
Copy link
Member

@dio dio left a comment

Choose a reason for hiding this comment

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

Makes sense. Thanks, @rgs1!

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());
Copy link
Member

Choose a reason for hiding this comment

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

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();
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this actually gets incremented twice as in the other case skip_compression_ is true?

Copy link
Member Author

Choose a reason for hiding this comment

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

Bah, you are right -- sorry :-(

Quick drive by diff while I was debugging something else. Sorry folks.

@rgs1
Copy link
Member Author

rgs1 commented Mar 18, 2020

Closing since this is doing the right thing.

@rgs1 rgs1 closed this Mar 18, 2020
@dio
Copy link
Member

dio commented Mar 19, 2020

Sorry misread the logic 🤦🏽‍♂️

@rgs1
Copy link
Member Author

rgs1 commented Mar 19, 2020

Sorry misread the logic 🤦🏽‍♂️

totally my bad, here's a better attempt hopefully: #10447

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.

3 participants