-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[pipeline](tracing) Fix pipeline tracing tools #35595
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
Conversation
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
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.
clang-tidy made some suggestions
| // belongs to exec_env, for all query, if enabled | ||
| class PipelineTracerContext { | ||
| public: | ||
| PipelineTracerContext() : _data(std::make_shared<QueryTracesMap>()) {} |
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.
warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
| PipelineTracerContext() : _data(std::make_shared<QueryTracesMap>()) {} | |
| PipelineTracerContext() : _data(std::make_shared<QueryTracesMap>()) = default; |
| def to_json(self) : | ||
| json = {"name": self.task_name, "cat": self.state_name, "ph": "X", "ts": self.start_time, "dur": self.end_time - self.start_time, | ||
| json = {"name": self.task_name, "ph": "X", "ts": self.start_time, "dur": self.end_time - self.start_time, | ||
| "pid": self.get_core(), "tid": self.thread_id} |
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.
add "args": {"tags": self.query_id} to find same query
|
run buildall |
|
TeamCity be ut coverage result: |
TPC-H: Total hot run time: 41147 ms |
TPC-DS: Total hot run time: 168823 ms |
ClickBench: Total hot run time: 30.44 s |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
| } | ||
|
|
||
| void PipelineTracerContext::_update(std::function<void(QueryTracesMap&)>&& handler) { | ||
| auto map_ptr = std::atomic_load_explicit(&_data, std::memory_order_relaxed); |
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.
do not use these atomic APIs for std::shared_ptr. they are deprecated in C++20 and will be removed in C++26. use std::atomic<shared_ptr> instead.
|
|
||
| ScheduleRecord record; | ||
| while (_datas[query_id].try_dequeue(record)) { | ||
| while ((*map_ptr)[QueryID {query_id}]->try_dequeue(record)) { |
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.
maybe here we should add some comment to let people know it's thread-safe by copy-and-swap for any possible modification.
Proposed changes
Issue Number: close #xxx