-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Profile] Make running profile clearer and more intuitive to improve usability #3405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,15 +172,13 @@ Status ExecNode::prepare(RuntimeState* state) { | |
| DCHECK(_runtime_profile.get() != NULL); | ||
| _rows_returned_counter = | ||
| ADD_COUNTER(_runtime_profile, "RowsReturned", TUnit::UNIT); | ||
| _memory_used_counter = | ||
| ADD_COUNTER(_runtime_profile, "MemoryUsed", TUnit::BYTES); | ||
| _rows_returned_rate = runtime_profile()->add_derived_counter( | ||
| ROW_THROUGHPUT_COUNTER, TUnit::UNIT_PER_SECOND, | ||
| boost::bind<int64_t>(&RuntimeProfile::units_per_second, | ||
| _rows_returned_counter, | ||
| runtime_profile()->total_time_counter()), | ||
| ""); | ||
| _mem_tracker.reset(new MemTracker(-1, _runtime_profile->name(), state->instance_mem_tracker())); | ||
| _mem_tracker.reset(new MemTracker(_runtime_profile.get(), -1, _runtime_profile->name(), state->instance_mem_tracker())); | ||
| _expr_mem_tracker.reset(new MemTracker(-1, "Exprs", _mem_tracker.get())); | ||
| _expr_mem_pool.reset(new MemPool(_expr_mem_tracker.get())); | ||
| // TODO chenhao | ||
|
|
@@ -339,7 +337,7 @@ Status ExecNode::create_tree_helper( | |
| } | ||
|
|
||
| if (!node->_children.empty()) { | ||
| node->runtime_profile()->add_child(node->_children[0]->runtime_profile(), false, NULL); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seem that the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| node->runtime_profile()->add_child(node->_children[0]->runtime_profile(), true, NULL); | ||
| } | ||
|
|
||
| return Status::OK(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,16 +72,6 @@ Status OlapScanNode::init(const TPlanNode& tnode, RuntimeState* state) { | |
| RETURN_IF_ERROR(ExecNode::init(tnode, state)); | ||
| _direct_conjunct_size = _conjunct_ctxs.size(); | ||
|
|
||
| if (tnode.olap_scan_node.__isset.sort_column) { | ||
| _is_result_order = true; | ||
| } else { | ||
| _is_result_order = false; | ||
| } | ||
|
|
||
| // Before, we support scan data ordered, but is not used in production | ||
| // Now, we drop this functional | ||
| DCHECK(!_is_result_order) << "ordered result don't support any more"; | ||
|
|
||
| return Status::OK(); | ||
| } | ||
|
|
||
|
|
@@ -668,6 +658,8 @@ Status OlapScanNode::start_scan_thread(RuntimeState* state) { | |
| } | ||
|
|
||
| int scanners_per_tablet = std::max(1, 64 / (int)_scan_ranges.size()); | ||
|
|
||
| std::unordered_set<std::string> disk_set; | ||
| for (auto& scan_range : _scan_ranges) { | ||
| std::vector<std::unique_ptr<OlapScanRange>>* ranges = &cond_ranges; | ||
| std::vector<std::unique_ptr<OlapScanRange>> split_ranges; | ||
|
|
@@ -702,8 +694,10 @@ Status OlapScanNode::start_scan_thread(RuntimeState* state) { | |
| state, this, _olap_scan_node.is_preaggregation, _need_agg_finalize, *scan_range, scanner_ranges); | ||
| _scanner_pool->add(scanner); | ||
| _olap_scanners.push_back(scanner); | ||
| disk_set.insert(scanner->scan_disk()); | ||
| } | ||
| } | ||
| COUNTER_SET(_num_disks_accessed_counter, static_cast<int64_t>(disk_set.size())); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this metric used for? If this metric is not useful, just remove it
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The metric help we now how many disk accessed in olap scan node scan data
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What can it be used for when you know how many disks accessed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can know whether the tablet of a query is allocated on different disks to know whether is IO bottleneck in disk |
||
|
|
||
| // init progress | ||
| std::stringstream ss; | ||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd better remove this field if it's not used. Btw,
_memory_used_counterseems to be used byHashJoinNode::close, is it really ok to remove it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, as we can see. this counter
_memory_used_counteris only used for count mem used for_tuple_pooland_hash_tbl.But the
_tuple_pooland_hash_tblwas already track the mem used byMemTrackerand counted mem used inPeakMemoryUsagecounter. We do really need this counter_memory_used_counter?So, I think keep the
_memory_used_counternamedMemoryUsedis confusing.I have two different suggestions
_memory_used_counterin the future, all mem used is tracked byMemTracker, we show peakmemusage it by the counter inMemTracker._memory_used_counter, but change the nameMemoryUsedtoMemoryUsedByHashBTAndTuplePool.Which suggestion do you think is more suitable?@gaodayue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer this.