Skip to content
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

Make running profile clearer and more intuitive to improve usability (#3365) #3383

Merged
merged 2 commits into from
Apr 24, 2020
Merged

Conversation

HappenLee
Copy link
Contributor

@HappenLee HappenLee commented Apr 23, 2020

This CL mainly made the following modifications:

  1. Delete Invalid method in Running Profile Class.
  2. Move Memlimit Counter from blockmgr to frgment and add PeakMemUsage Counter
  3. Fix the bug of buffer pool memlimit counter
  4. Call compute_time_in_profile() before pretty_print() to show the _local_time_percent without child running profile
  5. Add TransferThread ThreadToken count in AveThreadToken Counter

ISSUE: #3365

…3365)

This CL mainly made the following modifications:
1. Delete Invalid method in Running Profile Class.
2. Move Memlimit Counter from blockmgr to frgment and add PeakMemUsage Counter
3. Fix the bug of buffer pool memlimit counter
4. Call compute_time_in_profile() before pretty_print() to show the _local_time_percent without child running profile
5. Add TransferThread ThreadToken count in AveThreadToken Counter
@@ -1038,6 +1038,7 @@ Status OlapScanNode::normalize_binary_predicate(SlotDescriptor* slot, ColumnValu

void OlapScanNode::transfer_thread(RuntimeState* state) {
// scanner open pushdown to scanThread
state->resource_pool()->acquire_thread_token();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell the side effect of this operation? Will this thread hang if there is not enough thread resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this operation just to Make AverageThreadTokens more accurate

  • AverageThreadTokens: 1.00

Do not warry thread hang on this operation。
acquire_thread_token() just do a lightweight add operation without doing the really thread assignment

inline void ThreadResourceMgr::ResourcePool::acquire_thread_token() {
__sync_fetch_and_add(&_num_threads, 1);
}

@imay

_query_mem_tracker.reset(
new MemTracker(bytes_limit, runtime_profile()->name(), _exec_env->process_mem_tracker()));
new MemTracker(&_profile, bytes_limit, runtime_profile()->name(), _exec_env->process_mem_tracker()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add profile for this memory tracker, why not _instance_mem_tracker?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,I check code。the _instance_mem_tracker is more appropriate

change profile counter to _instance_mem_tracker
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morningman morningman merged commit 4eb27bc into apache:master Apr 24, 2020
acelyc111 pushed a commit to acelyc111/incubator-doris that referenced this pull request Apr 28, 2020
…usability (apache#3365) (apache#3383)

This CL mainly made the following modifications:
1. Delete Invalid method in Running Profile Class.
2. Move Memlimit Counter from blockmgr to fragment and add PeakMemUsage Counter
3. Fix the bug of buffer pool memlimit counter
4. Call compute_time_in_profile() before pretty_print() to show the _local_time_percent without child running profile
5. Add TransferThread ThreadToken count in AveThreadToken Counter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants