Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
Takuka0311 committed Nov 13, 2024
1 parent c0e1583 commit f09604d
Show file tree
Hide file tree
Showing 30 changed files with 92 additions and 93 deletions.
2 changes: 1 addition & 1 deletion core/common/compression/Compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace std;
namespace logtail {

void Compressor::SetMetricRecordRef(MetricLabels&& labels, DynamicMetricLabels&& dynamicLabels) {
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_COMPONENT, std::move(labels), std::move(dynamicLabels));
mInItemsTotal = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_IN_ITEMS_TOTAL);
mInItemSizeBytes = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_IN_SIZE_BYTES);
Expand Down
2 changes: 1 addition & 1 deletion core/ebpf/eBPFServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void eBPFServer::Init() {
mMonitorMgr = std::make_unique<eBPFSelfMonitorMgr>();
DynamicMetricLabels dynamicLabels;
dynamicLabels.emplace_back(METRIC_LABEL_KEY_PROJECT, [this]() -> std::string { return this->GetAllProjects(); });
MetricManager::GetInstance()->PrepareMetricsRecordRef(mRef,
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(mRef,
MetricCategory::METRIC_CATEGORY_RUNNER,
{{METRIC_LABEL_KEY_RUNNER_NAME, METRIC_LABEL_VALUE_RUNNER_NAME_EBPF_SERVER}},
std::move(dynamicLabels));
Expand Down
2 changes: 1 addition & 1 deletion core/file_server/FileServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace std;
namespace logtail {

FileServer::FileServer() {
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_RUNNER,
{{METRIC_LABEL_KEY_RUNNER_NAME, METRIC_LABEL_VALUE_RUNNER_NAME_FILE_SERVER}});
Expand Down
8 changes: 4 additions & 4 deletions core/monitor/MetricExportor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void MetricExportor::PushMetrics(bool forceSend) {
}

// go指标在Cpp指标前获取,是为了在 Cpp 部分指标做 SnapShot
// 前(即调用 MetricManagerReader::GetInstance()->UpdateMetrics() 函数),把go部分的进程级指标填写到 Cpp
// 前(即调用 ReadMetrics::GetInstance()->UpdateMetrics() 函数),把go部分的进程级指标填写到 Cpp
// 的进程级指标中去,随Cpp的进程级指标一起输出
if (LogtailPlugin::GetInstance()->IsPluginOpened()) {
PushGoMetrics();
Expand All @@ -60,15 +60,15 @@ void MetricExportor::PushMetrics(bool forceSend) {
}

void MetricExportor::PushCppMetrics() {
MetricManagerReader::GetInstance()->UpdateMetrics();
ReadMetrics::GetInstance()->UpdateMetrics();

if ("sls" == STRING_FLAG(metrics_report_method)) {
std::map<std::string, sls_logs::LogGroup*> logGroupMap;
MetricManagerReader::GetInstance()->ReadAsLogGroup(METRIC_LABEL_KEY_REGION, METRIC_REGION_DEFAULT, logGroupMap);
ReadMetrics::GetInstance()->ReadAsLogGroup(METRIC_LABEL_KEY_REGION, METRIC_REGION_DEFAULT, logGroupMap);
SendToSLS(logGroupMap);
} else if ("file" == STRING_FLAG(metrics_report_method)) {
std::string metricsContent;
MetricManagerReader::GetInstance()->ReadAsFileBuffer(metricsContent);
ReadMetrics::GetInstance()->ReadAsFileBuffer(metricsContent);
SendToLocalFile(metricsContent, "self-metrics-cpp");
}
}
Expand Down
28 changes: 14 additions & 14 deletions core/monitor/MetricManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ using namespace sls_logs;

namespace logtail {

MetricManager::~MetricManager() {
WriteMetrics::~WriteMetrics() {
Clear();
}

void MetricManager::PrepareMetricsRecordRef(MetricsRecordRef& ref,
void WriteMetrics::PrepareMetricsRecordRef(MetricsRecordRef& ref,
const std::string& category,
MetricLabels&& labels,
DynamicMetricLabels&& dynamicLabels) {
CreateMetricsRecordRef(ref, category, std::move(labels), std::move(dynamicLabels));
CommitMetricsRecordRef(ref);
}

void MetricManager::CreateMetricsRecordRef(MetricsRecordRef& ref,
void WriteMetrics::CreateMetricsRecordRef(MetricsRecordRef& ref,
const std::string& category,
MetricLabels&& labels,
DynamicMetricLabels&& dynamicLabels) {
Expand All @@ -45,18 +45,18 @@ void MetricManager::CreateMetricsRecordRef(MetricsRecordRef& ref,
ref.SetMetricsRecord(cur);
}

void MetricManager::CommitMetricsRecordRef(MetricsRecordRef& ref) {
void WriteMetrics::CommitMetricsRecordRef(MetricsRecordRef& ref) {
std::lock_guard<std::mutex> lock(mMutex);
ref.mMetrics->SetNext(mHead);
mHead = ref.mMetrics;
}

MetricsRecord* MetricManager::GetHead() {
MetricsRecord* WriteMetrics::GetHead() {
std::lock_guard<std::mutex> lock(mMutex);
return mHead;
}

void MetricManager::Clear() {
void WriteMetrics::Clear() {
std::lock_guard<std::mutex> lock(mMutex);
while (mHead) {
MetricsRecord* toDeleted = mHead;
Expand All @@ -65,7 +65,7 @@ void MetricManager::Clear() {
}
}

MetricsRecord* MetricManager::DoSnapshot() {
MetricsRecord* WriteMetrics::DoSnapshot() {
// new read head
MetricsRecord* snapshot = nullptr;
MetricsRecord* toDeleteHead = nullptr;
Expand Down Expand Up @@ -146,11 +146,11 @@ MetricsRecord* MetricManager::DoSnapshot() {
return snapshot;
}

MetricManagerReader::~MetricManagerReader() {
ReadMetrics::~ReadMetrics() {
Clear();
}

void MetricManagerReader::ReadAsLogGroup(const std::string& regionFieldName,
void ReadMetrics::ReadAsLogGroup(const std::string& regionFieldName,
const std::string& defaultRegion,
std::map<std::string, sls_logs::LogGroup*>& logGroupMap) const {
ReadLock lock(mReadWriteLock);
Expand Down Expand Up @@ -241,7 +241,7 @@ void MetricManagerReader::ReadAsLogGroup(const std::string& regionFieldName,
}
}

void MetricManagerReader::ReadAsFileBuffer(std::string& metricsContent) const {
void ReadMetrics::ReadAsFileBuffer(std::string& metricsContent) const {
ReadLock lock(mReadWriteLock);

std::ostringstream oss;
Expand Down Expand Up @@ -292,8 +292,8 @@ void MetricManagerReader::ReadAsFileBuffer(std::string& metricsContent) const {
metricsContent = oss.str();
}

void MetricManagerReader::UpdateMetrics() {
MetricsRecord* snapshot = MetricManager::GetInstance()->DoSnapshot();
void ReadMetrics::UpdateMetrics() {
MetricsRecord* snapshot = WriteMetrics::GetInstance()->DoSnapshot();
MetricsRecord* toDelete;
{
// Only lock when change head
Expand All @@ -309,12 +309,12 @@ void MetricManagerReader::UpdateMetrics() {
}
}

MetricsRecord* MetricManagerReader::GetHead() {
MetricsRecord* ReadMetrics::GetHead() {
WriteLock lock(mReadWriteLock);
return mHead;
}

void MetricManagerReader::Clear() {
void ReadMetrics::Clear() {
WriteLock lock(mReadWriteLock);
while (mHead) {
MetricsRecord* toDelete = mHead;
Expand Down
20 changes: 10 additions & 10 deletions core/monitor/MetricManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@

namespace logtail {

class MetricManager {
class WriteMetrics {
private:
MetricManager() = default;
WriteMetrics() = default;
std::mutex mMutex;
MetricsRecord* mHead = nullptr;

void Clear();
MetricsRecord* GetHead();

public:
~MetricManager();
static MetricManager* GetInstance() {
static MetricManager* ptr = new MetricManager();
~WriteMetrics();
static WriteMetrics* GetInstance() {
static WriteMetrics* ptr = new WriteMetrics();
return ptr;
}

Expand All @@ -61,18 +61,18 @@ class MetricManager {
#endif
};

class MetricManagerReader {
class ReadMetrics {
private:
MetricManagerReader() = default;
ReadMetrics() = default;
mutable ReadWriteLock mReadWriteLock;
MetricsRecord* mHead = nullptr;
void Clear();
MetricsRecord* GetHead();

public:
~MetricManagerReader();
static MetricManagerReader* GetInstance() {
static MetricManagerReader* ptr = new MetricManagerReader();
~ReadMetrics();
static ReadMetrics* GetInstance() {
static ReadMetrics* ptr = new ReadMetrics();
return ptr;
}
void ReadAsLogGroup(const std::string& regionFieldName,
Expand Down
4 changes: 2 additions & 2 deletions core/monitor/MetricRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class MetricsRecord {
};

class MetricsRecordRef {
friend class MetricManager;
friend class WriteMetrics;
friend bool operator==(const MetricsRecordRef& lhs, std::nullptr_t rhs);
friend bool operator==(std::nullptr_t rhs, const MetricsRecordRef& lhs);

Expand All @@ -91,7 +91,7 @@ class MetricsRecordRef {
IntGaugePtr CreateIntGauge(const std::string& name);
DoubleGaugePtr CreateDoubleGauge(const std::string& name);
const MetricsRecord* operator->() const;
// this is not thread-safe, and should be only used before MetricManager::CommitMetricsRecordRef
// this is not thread-safe, and should be only used before WriteMetrics::CommitMetricsRecordRef
void AddLabels(MetricLabels&& labels);
#ifdef APSARA_UNIT_TEST_MAIN
bool HasLabel(const std::string& key, const std::string& value) const;
Expand Down
2 changes: 1 addition & 1 deletion core/monitor/Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ void LoongCollectorMonitor::Init() {
return EnterpriseConfigProvider::GetInstance()->GetUserDefinedIdSet();
});
#endif
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_AGENT, std::move(labels), std::move(dynamicLabels));
// init value
mAgentCpu = mMetricsRecordRef.CreateDoubleGauge(METRIC_AGENT_CPU);
Expand Down
2 changes: 1 addition & 1 deletion core/monitor/PluginMetricManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void ReentrantMetricsRecord::Init(const std::string& category,
MetricLabels& labels,
DynamicMetricLabels& dynamicLabels,
std::unordered_map<std::string, MetricType>& metricKeys) {
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef, category, std::move(labels), std::move(dynamicLabels));
for (auto metric : metricKeys) {
switch (metric.second) {
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/Pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ bool Pipeline::Init(PipelineConfig&& config) {
ProcessQueueManager::GetInstance()->SetDownStreamQueues(mContext.GetProcessQueueKey(), std::move(senderQueues));
}

MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_PIPELINE,
{{METRIC_LABEL_KEY_PROJECT, mContext.GetProjectName()}, {METRIC_LABEL_KEY_PIPELINE_NAME, mName}});
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/batch/Batcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Batcher {
} else {
labels.emplace_back(METRIC_LABEL_KEY_GROUP_BATCH_ENABLED, "false");
}
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_COMPONENT, std::move(labels));
mInEventsTotal = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_IN_EVENTS_TOTAL);
mInGroupDataSizeBytes = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_IN_SIZE_BYTES);
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/plugin/interface/Plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Plugin {
void SetContext(PipelineContext& context) { mContext = &context; }
MetricsRecordRef& GetMetricsRecordRef() const { return mMetricsRecordRef; }
void SetMetricsRecordRef(const std::string& name, const std::string& id) {
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_PLUGIN,
{{METRIC_LABEL_KEY_PROJECT, mContext->GetProjectName()},
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/queue/BoundedProcessQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BoundedProcessQueue::BoundedProcessQueue(
if (ctx.IsExactlyOnceEnabled()) {
mMetricsRecordRef.AddLabels({{METRIC_LABEL_KEY_EXACTLY_ONCE_ENABLED, "true"}});
}
MetricManager::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
WriteMetrics::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
}

bool BoundedProcessQueue::Push(unique_ptr<ProcessQueueItem>&& item) {
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/queue/CircularProcessQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CircularProcessQueue::CircularProcessQueue(size_t cap, int64_t key, uint32_t pri
: QueueInterface<std::unique_ptr<ProcessQueueItem>>(key, cap, ctx), ProcessQueueInterface(key, cap, priority, ctx) {
mMetricsRecordRef.AddLabels({{METRIC_LABEL_KEY_QUEUE_TYPE, "circular"}});
mDiscardedEventsTotal = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_QUEUE_DISCARDED_EVENTS_TOTAL);
MetricManager::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
WriteMetrics::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
}

bool CircularProcessQueue::Push(unique_ptr<ProcessQueueItem>&& item) {
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/queue/ExactlyOnceSenderQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ExactlyOnceSenderQueue::ExactlyOnceSenderQueue(const std::vector<RangeCheckpoint
mRangeCheckpoints(checkpoints) {
mQueue.resize(checkpoints.size());
mMetricsRecordRef.AddLabels({{METRIC_LABEL_KEY_EXACTLY_ONCE_ENABLED, "true"}});
MetricManager::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
WriteMetrics::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
}

bool ExactlyOnceSenderQueue::Push(unique_ptr<SenderQueueItem>&& item) {
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/queue/QueueInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template <typename T>
class QueueInterface {
public:
QueueInterface(QueueKey key, size_t cap, const PipelineContext& ctx) : mKey(key), mCapacity(cap) {
MetricManager::GetInstance()->CreateMetricsRecordRef(mMetricsRecordRef,
WriteMetrics::GetInstance()->CreateMetricsRecordRef(mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_COMPONENT,
{
{METRIC_LABEL_KEY_PROJECT, ctx.GetProjectName()},
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/queue/SenderQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SenderQueue::SenderQueue(
mFetchTimesCnt = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_QUEUE_FETCH_TIMES_TOTAL);
mValidFetchTimesCnt = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_QUEUE_VALID_FETCH_TIMES_TOTAL);
mFetchedItemsCnt = mMetricsRecordRef.CreateCounter(METRIC_COMPONENT_QUEUE_FETCHED_ITEMS_TOTAL);
MetricManager::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
WriteMetrics::GetInstance()->CommitMetricsRecordRef(mMetricsRecordRef);
}

bool SenderQueue::Push(unique_ptr<SenderQueueItem>&& item) {
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/route/Router.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ bool Router::Init(std::vector<pair<size_t, const Json::Value*>> configs, const P
}
}

MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_COMPONENT,
{{METRIC_LABEL_KEY_PROJECT, ctx.GetProjectName()},
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/serializer/Serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ template <typename T>
class Serializer {
public:
Serializer(Flusher* f) : mFlusher(f) {
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_COMPONENT,
{{METRIC_LABEL_KEY_PROJECT, f->GetContext().GetProjectName()},
Expand Down
2 changes: 1 addition & 1 deletion core/prometheus/PrometheusInputRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ PrometheusInputRunner::PrometheusInputRunner()
DynamicMetricLabels dynamicLabels;
dynamicLabels.emplace_back(METRIC_LABEL_KEY_PROJECT, [this]() -> std::string { return this->GetAllProjects(); });

MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_RUNNER, std::move(labels), std::move(dynamicLabels));

mPromRegisterState = mMetricsRecordRef.CreateIntGauge(METRIC_RUNNER_CLIENT_REGISTER_STATE);
Expand Down
2 changes: 1 addition & 1 deletion core/prometheus/schedulers/ScrapeScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void ScrapeScheduler::InitSelfMonitor(const MetricLabels& defaultLabels) {

mSelfMonitor->InitMetricManager(sScrapeMetricKeys, labels);

MetricManager::GetInstance()->PrepareMetricsRecordRef(mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_PLUGIN_SOURCE, std::move(labels));
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_PLUGIN_SOURCE, std::move(labels));
mPromDelayTotal = mMetricsRecordRef.CreateCounter(METRIC_PLUGIN_PROM_SCRAPE_DELAY_TOTAL);
mPluginTotalDelayMs = mMetricsRecordRef.CreateCounter(METRIC_PLUGIN_TOTAL_DELAY_MS);
}
Expand Down
2 changes: 1 addition & 1 deletion core/prometheus/schedulers/TargetSubscriberScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ void TargetSubscriberScheduler::InitSelfMonitor(const MetricLabels& defaultLabel
mSelfMonitor = std::make_shared<PromSelfMonitorUnsafe>();
mSelfMonitor->InitMetricManager(sSubscriberMetricKeys, mDefaultLabels);

MetricManager::GetInstance()->PrepareMetricsRecordRef(mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_PLUGIN_SOURCE, std::move(mDefaultLabels));
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(mMetricsRecordRef, MetricCategory::METRIC_CATEGORY_PLUGIN_SOURCE, std::move(mDefaultLabels));
mPromSubscriberTargets = mMetricsRecordRef.CreateIntGauge(METRIC_PLUGIN_PROM_SUBSCRIBE_TARGETS);
mTotalDelayMs = mMetricsRecordRef.CreateCounter(METRIC_PLUGIN_TOTAL_DELAY_MS);
}
Expand Down
2 changes: 1 addition & 1 deletion core/runner/FlusherRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bool FlusherRunner::Init() {
mCallback = [this]() { return LoadModuleConfig(false); };
AppConfig::GetInstance()->RegisterCallback("max_bytes_per_sec", &mCallback);

MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_RUNNER,
{{METRIC_LABEL_KEY_RUNNER_NAME, METRIC_LABEL_VALUE_RUNNER_NAME_FLUSHER}});
Expand Down
2 changes: 1 addition & 1 deletion core/runner/ProcessorRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void ProcessorRunner::Run(uint32_t threadNo) {
LOG_INFO(sLogger, ("processor runner", "started")("thread no", threadNo));

// thread local metrics should be initialized in each thread
MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
sMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_RUNNER,
{{METRIC_LABEL_KEY_RUNNER_NAME, METRIC_LABEL_VALUE_RUNNER_NAME_PROCESSOR},
Expand Down
2 changes: 1 addition & 1 deletion core/runner/sink/http/HttpSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool HttpSink::Init() {
return false;
}

MetricManager::GetInstance()->PrepareMetricsRecordRef(
WriteMetrics::GetInstance()->PrepareMetricsRecordRef(
mMetricsRecordRef,
MetricCategory::METRIC_CATEGORY_RUNNER,
{{METRIC_LABEL_KEY_RUNNER_NAME, METRIC_LABEL_VALUE_RUNNER_NAME_HTTP_SINK}});
Expand Down
1 change: 0 additions & 1 deletion core/unittest/input/InputNetworkObserverUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ void InputNetworkObserverUnittest::OnSuccessfulStart() {
unique_ptr<InputNetworkObserver> input;
Json::Value configJson, optionalGoPipeline;
string configStr, errorMsg;
uint32_t pluginIdx = 0;

configStr = R"(
{
Expand Down
Loading

0 comments on commit f09604d

Please sign in to comment.