Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/core/src/exec/operator/FilterBitsNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ PhyFilterBitsNode::GetOutput() {
bitset.flip();
Assert(bitset.size() == need_process_rows_);
Assert(valid_bitset.size() == need_process_rows_);
auto filter_ratio =
bitset.size() != 0 ? 1 - float(bitset.count()) / bitset.size() : 0;
monitor::internal_core_expr_filter_ratio.Observe(filter_ratio);
// num_processed_rows_ = need_process_rows_;
std::vector<VectorPtr> col_res;
col_res.push_back(std::make_shared<ColumnVector>(std::move(bitset),
Expand Down
6 changes: 6 additions & 0 deletions internal/core/src/monitor/prometheus_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ std::map<std::string, std::string> randomSampleLatencyLabels{
{"type", "random_sample_latency"}};
std::map<std::string, std::string> optimizeExprLatencyLabels{
{"type", "optimize_expr_latency"}};
std::map<std::string, std::string> filterRatioLabels{
{"type", "expr_filter_ratio"}};

DEFINE_PROMETHEUS_HISTOGRAM_FAMILY(internal_core_search_latency,
"[cpp]latency(us) of search on segment")
Expand Down Expand Up @@ -247,6 +249,10 @@ DEFINE_PROMETHEUS_HISTOGRAM(internal_core_search_latency_random_sample,
DEFINE_PROMETHEUS_HISTOGRAM(internal_core_optimize_expr_latency,
internal_core_search_latency,
optimizeExprLatencyLabels)
DEFINE_PROMETHEUS_HISTOGRAM_WITH_BUCKETS(internal_core_expr_filter_ratio,
internal_core_search_latency,
filterRatioLabels,
ratioBuckets)
// mmap metrics
std::map<std::string, std::string> mmapAllocatedSpaceAnonLabel = {
{"type", "anon"}};
Expand Down
1 change: 1 addition & 0 deletions internal/core/src/monitor/prometheus_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ DECLARE_PROMETHEUS_HISTOGRAM(internal_core_retrieve_get_target_entry_latency);
DECLARE_PROMETHEUS_HISTOGRAM(internal_core_search_get_target_entry_latency);
DECLARE_PROMETHEUS_HISTOGRAM(internal_core_search_latency_random_sample);
DECLARE_PROMETHEUS_HISTOGRAM(internal_core_optimize_expr_latency);
DECLARE_PROMETHEUS_HISTOGRAM(internal_core_expr_filter_ratio);

// async cgo metrics
DECLARE_PROMETHEUS_HISTOGRAM_FAMILY(internal_cgo_queue_duration_seconds);
Expand Down
Loading