[metrics](bvar) add bvar for load stream and file writer count (#36300) (#36336)

cherry-pick #36300
This commit is contained in:
Kaijie Chen
2024-06-16 10:14:59 +08:00
committed by GitHub
parent 98fccb1809
commit 6bb670ab38
2 changed files with 14 additions and 1 deletions

View File

@ -30,6 +30,7 @@
#include <memory>
#include <sstream>
#include "bvar/bvar.h"
#include "common/signal_handler.h"
#include "exec/tablet_info.h"
#include "gutil/ref_counted.h"
@ -48,6 +49,7 @@
namespace doris {
bvar::Adder<int64_t> g_load_stream_cnt("load_stream_count");
bvar::LatencyRecorder g_load_stream_flush_wait_ms("load_stream_flush_wait_ms");
bvar::Adder<int> g_load_stream_flush_running_threads("load_stream_flush_wait_threads");
@ -330,6 +332,7 @@ Status IndexStream::close(const std::vector<PTabletID>& tablets_to_commit,
// 2. There are some problems in _profile->to_thrift()
LoadStream::LoadStream(PUniqueId load_id, LoadStreamMgr* load_stream_mgr, bool enable_profile)
: _load_id(load_id), _enable_profile(false), _load_stream_mgr(load_stream_mgr) {
g_load_stream_cnt << 1;
_profile = std::make_unique<RuntimeProfile>("LoadStream");
_append_data_timer = ADD_TIMER(_profile, "AppendDataTime");
_close_wait_timer = ADD_TIMER(_profile, "CloseWaitTime");
@ -354,6 +357,7 @@ LoadStream::LoadStream(PUniqueId load_id, LoadStreamMgr* load_stream_mgr, bool e
}
LoadStream::~LoadStream() {
g_load_stream_cnt << -1;
LOG(INFO) << "load stream is deconstructed " << *this;
}