Skip to content

Commit

Permalink
fix flusher_sls ut (#1874)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryzhx8 authored Nov 12, 2024
1 parent fd95ac6 commit 314785e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/plugin/flusher/sls/FlusherSLS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ bool FlusherSLS::Init(const Json::Value& config, Json::Value& optionalGoPipeline
}

DefaultFlushStrategyOptions strategy{
static_cast<uint32_t>(INT32_FLAG(max_send_log_group_size) / INT32_FLAG(sls_serialize_size_expansion_ratio)),
static_cast<uint32_t>(INT32_FLAG(max_send_log_group_size) / DOUBLE_FLAG(sls_serialize_size_expansion_ratio)),
static_cast<uint32_t>(INT32_FLAG(batch_send_metric_size)),
static_cast<uint32_t>(INT32_FLAG(merge_log_count_limit)),
static_cast<uint32_t>(INT32_FLAG(batch_send_interval))};
Expand Down
3 changes: 2 additions & 1 deletion core/unittest/flusher/FlusherSLSUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ DECLARE_FLAG_INT32(batch_send_interval);
DECLARE_FLAG_INT32(merge_log_count_limit);
DECLARE_FLAG_INT32(batch_send_metric_size);
DECLARE_FLAG_INT32(max_send_log_group_size);
DECLARE_FLAG_DOUBLE(sls_serialize_size_expansion_ratio);

using namespace std;

Expand Down Expand Up @@ -108,7 +109,7 @@ void FlusherSLSUnittest::OnSuccessfulInit() {
APSARA_TEST_TRUE(flusher->mShardHashKeys.empty());
APSARA_TEST_EQUAL(static_cast<uint32_t>(INT32_FLAG(merge_log_count_limit)),
flusher->mBatcher.GetEventFlushStrategy().GetMinCnt());
APSARA_TEST_EQUAL(static_cast<uint32_t>(INT32_FLAG(max_send_log_group_size)),
APSARA_TEST_EQUAL(static_cast<uint32_t>(INT32_FLAG(max_send_log_group_size) / DOUBLE_FLAG(sls_serialize_size_expansion_ratio)),
flusher->mBatcher.GetEventFlushStrategy().GetMaxSizeBytes());
APSARA_TEST_EQUAL(static_cast<uint32_t>(INT32_FLAG(batch_send_metric_size)),
flusher->mBatcher.GetEventFlushStrategy().GetMinSizeBytes());
Expand Down

0 comments on commit 314785e

Please sign in to comment.