[vectorized](profile) fix pipeline profile can't get result under more instances (#18525)
when enable pipeline to true, and set instances > 1 because all scan nodes share the scanners, maybe get the profile of scan node is all empty now show all the scan nodes and remove some infos those that _num_scanners->value() == 0
This commit is contained in:
@ -82,7 +82,6 @@ Status VScanNode::init(const TPlanNode& tnode, RuntimeState* state) {
|
||||
}
|
||||
|
||||
RETURN_IF_ERROR(_register_runtime_filter());
|
||||
RETURN_IF_ERROR(_init_profile());
|
||||
|
||||
return Status::OK();
|
||||
}
|
||||
@ -109,6 +108,17 @@ Status VScanNode::prepare(RuntimeState* state) {
|
||||
}
|
||||
}
|
||||
|
||||
// 1: running at not pipeline mode will init profile.
|
||||
// 2: the scan node should create scanner at pipeline mode will init profile.
|
||||
// during pipeline mode with more instances, olap scan node maybe not new VScanner object,
|
||||
// so the profile of VScanner and SegmentIterator infos are always empty, could not init those.
|
||||
if (!_is_pipeline_scan || _should_create_scanner) {
|
||||
RETURN_IF_ERROR(_init_profile());
|
||||
}
|
||||
// if you want to add some profile in scan node, even it have not new VScanner object
|
||||
// could add here, not in the _init_profile() function
|
||||
_get_next_timer = ADD_TIMER(_runtime_profile, "GetNextTime");
|
||||
_acquire_runtime_filter_timer = ADD_TIMER(_runtime_profile, "AcuireRuntimeFilterTime");
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
@ -224,8 +234,6 @@ Status VScanNode::_init_profile() {
|
||||
_total_throughput_counter =
|
||||
runtime_profile()->add_rate_counter("TotalReadThroughput", _rows_read_counter);
|
||||
_num_scanners = ADD_COUNTER(_runtime_profile, "NumScanners", TUnit::UNIT);
|
||||
_get_next_timer = ADD_TIMER(_runtime_profile, "GetNextTime");
|
||||
_acquire_runtime_filter_timer = ADD_TIMER(_runtime_profile, "AcuireRuntimeFilterTime");
|
||||
|
||||
// 2. counters for scanners
|
||||
_scanner_profile.reset(new RuntimeProfile("VScanner"));
|
||||
|
||||
Reference in New Issue
Block a user