Skip to content

Commit

Permalink
update: remove enable-compression config temporarily (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
catdogpandas authored Oct 8, 2024
1 parent bf7de40 commit 6526c34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/prometheus/schedulers/ScrapeConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ bool ScrapeConfig::Init(const Json::Value& scrapeConfig) {

if (scrapeConfig.isMember(prometheus::ENABLE_COMPRESSION)
&& scrapeConfig[prometheus::ENABLE_COMPRESSION].isBool()) {
InitEnableCompression(scrapeConfig[prometheus::ENABLE_COMPRESSION].asBool());
// InitEnableCompression(scrapeConfig[prometheus::ENABLE_COMPRESSION].asBool());
} else {
InitEnableCompression(true);
// InitEnableCompression(true);
}

// basic auth, authorization, oauth2
Expand Down
8 changes: 4 additions & 4 deletions core/unittest/prometheus/ScrapeConfigUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void ScrapeConfigUnittest::TestInit() {
"application/openmetrics-text;version=0.0.1;q=0.2,*/*;q=0.1");

// disable compression
APSARA_TEST_EQUAL(scrapeConfig.mRequestHeaders["Accept-Encoding"], "identity");
// APSARA_TEST_EQUAL(scrapeConfig.mRequestHeaders["Accept-Encoding"], "identity");

// basic auth
APSARA_TEST_EQUAL(scrapeConfig.mRequestHeaders["Authorization"], "Basic dGVzdF91c2VyOnRlc3RfcGFzc3dvcmQ=");
Expand Down Expand Up @@ -383,7 +383,7 @@ void ScrapeConfigUnittest::TestEnableCompression() {
APSARA_TEST_TRUE(ParseJsonTable(configStr, config, errorMsg));
scrapeConfig.mRequestHeaders.clear();
APSARA_TEST_TRUE(scrapeConfig.Init(config));
APSARA_TEST_EQUAL("gzip", scrapeConfig.mRequestHeaders["Accept-Encoding"]);
// APSARA_TEST_EQUAL("gzip", scrapeConfig.mRequestHeaders["Accept-Encoding"]);

// disable
configStr = R"JSON({
Expand All @@ -397,7 +397,7 @@ void ScrapeConfigUnittest::TestEnableCompression() {
APSARA_TEST_TRUE(ParseJsonTable(configStr, config, errorMsg));
scrapeConfig.mRequestHeaders.clear();
APSARA_TEST_TRUE(scrapeConfig.Init(config));
APSARA_TEST_EQUAL("identity", scrapeConfig.mRequestHeaders["Accept-Encoding"]);
// APSARA_TEST_EQUAL("identity", scrapeConfig.mRequestHeaders["Accept-Encoding"]);

// enable
configStr = R"JSON({
Expand All @@ -411,7 +411,7 @@ void ScrapeConfigUnittest::TestEnableCompression() {
APSARA_TEST_TRUE(ParseJsonTable(configStr, config, errorMsg));
scrapeConfig.mRequestHeaders.clear();
APSARA_TEST_TRUE(scrapeConfig.Init(config));
APSARA_TEST_EQUAL("gzip", scrapeConfig.mRequestHeaders["Accept-Encoding"]);
// APSARA_TEST_EQUAL("gzip", scrapeConfig.mRequestHeaders["Accept-Encoding"]);
}

UNIT_TEST_CASE(ScrapeConfigUnittest, TestInit);
Expand Down

0 comments on commit 6526c34

Please sign in to comment.