Skip to content

Commit

Permalink
Add some logs about concurrency (#8214)
Browse files Browse the repository at this point in the history
close #8215
  • Loading branch information
SeaRise authored Oct 18, 2023
1 parent 3e19c27 commit 81059d6
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbms/src/Flash/Executor/PipelineExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void PipelineExecutor::cancel()
String PipelineExecutor::toString() const
{
assert(root_pipeline);
return root_pipeline->toTreeString();
return fmt::format("query concurrency: {}\n{}", context.getMaxStreams(), root_pipeline->toTreeString());
}

int PipelineExecutor::estimateNewThreadCount()
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Flash/Statistics/BaseRuntimeStatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#pragma once

#include <Common/FmtUtils.h>
#include <common/types.h>

namespace DB
Expand Down
3 changes: 2 additions & 1 deletion dbms/src/Flash/Statistics/ExecutorStatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ class ExecutorStatistics : public ExecutorStatisticsBase
[](const String & child, FmtBuffer & bf) { bf.fmtAppend(R"("{}")", child); },
",");
fmt_buffer.fmtAppend(
R"(],"outbound_rows":{},"outbound_blocks":{},"outbound_bytes":{},"outbound_allocated_bytes":{},"execution_time_ns":{})",
R"(],"outbound_rows":{},"outbound_blocks":{},"outbound_bytes":{},"outbound_allocated_bytes":{},"concurrency":{},"execution_time_ns":{})",
base.rows,
base.blocks,
base.bytes,
base.allocated_bytes,
base.concurrency,
base.execution_time_ns);
if constexpr (ExecutorImpl::has_extra_info)
{
Expand Down
6 changes: 4 additions & 2 deletions dbms/src/Flash/Statistics/JoinImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ namespace DB
void JoinStatistics::appendExtraJson(FmtBuffer & fmt_buffer) const
{
fmt_buffer.fmtAppend(
R"("peak_build_bytes_usage":{},"build_side_child":"{}","is_spill_enabled":{},"is_spilled":{})"
R"("join_build_inbound_rows":{},"join_build_inbound_blocks":{},"join_build_inbound_bytes":{},"join_build_inbound_allocated_bytes":{}, "join_build_execution_time_ns":{})",
R"("peak_build_bytes_usage":{},"build_side_child":"{}","is_spill_enabled":{},"is_spilled":{},)"
R"("join_build_inbound_rows":{},"join_build_inbound_blocks":{},"join_build_inbound_bytes":{},)"
R"("join_build_inbound_allocated_bytes":{},"join_build_concurrency":{},"join_build_execution_time_ns":{})",
peak_build_bytes_usage,
build_side_child,
is_spill_enabled,
Expand All @@ -30,6 +31,7 @@ void JoinStatistics::appendExtraJson(FmtBuffer & fmt_buffer) const
join_build_base.blocks,
join_build_base.bytes,
join_build_base.allocated_bytes,
join_build_base.concurrency,
join_build_base.execution_time_ns);
}

Expand Down
Loading

0 comments on commit 81059d6

Please sign in to comment.