Skip to content

Commit 2c12da3

Browse files
committed
polish
1 parent 37a00a2 commit 2c12da3

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

Diff for: core/collection_pipeline/serializer/JsonSerializer.cpp

+13-14
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,20 @@ using namespace std;
2525

2626
namespace logtail {
2727

28-
29-
const char* JSON_KEY_TIME = "__time__";
30-
31-
// Helper function to serialize common fields (tags and time)
32-
template <typename WriterType>
33-
void SerializeCommonFields(const SizedMap& tags, uint64_t timestamp, WriterType& writer) {
34-
// Serialize tags
35-
for (const auto& tag : tags.mInner) {
36-
writer.Key(tag.first.to_string().c_str());
37-
writer.String(tag.second.to_string().c_str());
38-
}
39-
// Serialize time
40-
writer.Key(JSON_KEY_TIME);
41-
writer.Uint64(timestamp);
28+
const char* JSON_KEY_TIME = "__time__";
29+
30+
// Helper function to serialize common fields (tags and time)
31+
template <typename WriterType>
32+
void SerializeCommonFields(const SizedMap& tags, uint64_t timestamp, WriterType& writer) {
33+
// Serialize tags
34+
for (const auto& tag : tags.mInner) {
35+
writer.Key(tag.first.to_string().c_str());
36+
writer.String(tag.second.to_string().c_str());
4237
}
38+
// Serialize time
39+
writer.Key(JSON_KEY_TIME);
40+
writer.Uint64(timestamp);
41+
}
4342

4443
bool JsonEventGroupSerializer::Serialize(BatchedEvents&& group, string& res, string& errorMsg) {
4544
if (group.mEvents.empty()) {

Diff for: core/plugin/flusher/file/FlusherFile.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ bool FlusherFile::Init(const Json::Value& config, Json::Value& optionalGoPipelin
5454
sName, fileSink, spdlog::thread_pool(), spdlog::async_overflow_policy::block);
5555
mFileWriter->set_pattern("%v");
5656

57-
mBatcher.Init(Json::Value(), this, DefaultFlushStrategyOptions{});
5857
mGroupSerializer = make_unique<JsonEventGroupSerializer>(this);
5958
mSendCnt = GetMetricsRecordRef().CreateCounter(METRIC_PLUGIN_FLUSHER_OUT_EVENT_GROUPS_TOTAL);
6059
return true;

0 commit comments

Comments
 (0)