Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.doris.common.util.ProfileManager;
import org.apache.doris.common.util.RuntimeProfile;
import org.apache.doris.nereids.NereidsPlanner;
import org.apache.doris.planner.Planner;

import com.google.common.collect.Lists;
Expand Down Expand Up @@ -96,6 +97,11 @@ public synchronized void updateSummary(long startTime, Map<String, String> summa
if (this.isFinished) {
return;
}
if (planner instanceof NereidsPlanner) {
summaryInfo.put(SummaryProfile.PHYSICAL_PLAN,
((NereidsPlanner) planner).getPhysicalPlan()
.treeString().replace("\n", "\n "));
}
summaryProfile.update(summaryInfo);
for (ExecutionProfile executionProfile : executionProfiles) {
// Tell execution profile the start time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class SummaryProfile {
public static final String PARALLEL_FRAGMENT_EXEC_INSTANCE = "Parallel Fragment Exec Instance Num";
public static final String TRACE_ID = "Trace ID";
public static final String WORKLOAD_GROUP = "Workload Group";

public static final String PHYSICAL_PLAN = "Physical Plan";
// Execution Summary
public static final String EXECUTION_SUMMARY_PROFILE_NAME = "Execution Summary";
public static final String ANALYSIS_TIME = "Analysis Time";
Expand Down Expand Up @@ -105,8 +105,12 @@ public class SummaryProfile {
// These info will display on FE's web ui table, every one will be displayed as
// a column, so that should not
// add many columns here. Add to ExecutionSummary list.
public static final ImmutableList<String> SUMMARY_KEYS = ImmutableList.of(PROFILE_ID, TASK_TYPE,
public static final ImmutableList<String> SUMMARY_CAPTIONS = ImmutableList.of(PROFILE_ID, TASK_TYPE,
START_TIME, END_TIME, TOTAL_TIME, TASK_STATE, USER, DEFAULT_DB, SQL_STATEMENT);
public static final ImmutableList<String> SUMMARY_KEYS = new ImmutableList.Builder<String>()
.addAll(SUMMARY_CAPTIONS)
.add(PHYSICAL_PLAN)
.build();

// The display order of execution summary items.
public static final ImmutableList<String> EXECUTION_SUMMARY_KEYS = ImmutableList.of(
Expand Down Expand Up @@ -284,7 +288,7 @@ public void prettyPrint(StringBuilder builder) {

public Map<String, String> getAsInfoStings() {
Map<String, String> infoStrings = Maps.newHashMap();
for (String header : SummaryProfile.SUMMARY_KEYS) {
for (String header : SummaryProfile.SUMMARY_CAPTIONS) {
infoStrings.put(header, summaryProfile.getInfoString(header));
}
return infoStrings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Object query() {
private void addFinishedQueryInfo(Map<String, Object> result) {
List<List<String>> finishedQueries = ProfileManager.getInstance().getAllQueries();
List<String> columnHeaders = Lists.newLinkedList();
columnHeaders.addAll(SummaryProfile.SUMMARY_KEYS);
columnHeaders.addAll(SummaryProfile.SUMMARY_CAPTIONS);

result.put("column_names", columnHeaders);
// The first column is profile id, which is also a href column
Expand All @@ -79,7 +79,7 @@ private void addFinishedQueryInfo(Map<String, Object> result) {

for (List<String> row : finishedQueries) {
Map<String, Object> rowMap = new HashMap<>();
for (int i = 0; i < row.size(); ++i) {
for (int i = 0; i < columnHeaders.size(); ++i) {
rowMap.put(columnHeaders.get(i), row.get(i));
}

Expand Down