Skip to content
Merged
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
17 changes: 15 additions & 2 deletions presto-native-execution/presto_cpp/main/PrestoTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,22 @@ protocol::TaskInfo PrestoTask::updateInfoLocked() {

std::unordered_map<std::string, RuntimeMetric> taskRuntimeStats;

if (taskStats.memoryReclaimCount > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to report these stats live while query is running.

There is code later that calls processTaskStats which clears taskRuntimeStats if query is not running.

Also, I noticed that Coordinator UI shows stats based on unit. Hence, you need to specify kNanos unit to ensure nice display.

For example,

  taskRuntimeStats.insert(
      {"nativeProcessCpuTime",
       RuntimeMetric(processCpuTime_, RuntimeCounter::Unit::kNanos)});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean to call processTaskStats with tryToSkipIfRunning to false?

taskRuntimeStats["memoryReclaimCount"].addValue(
taskStats.memoryReclaimCount);
taskRuntimeStats.insert(
{"memoryReclaimWallNanos",
RuntimeMetric(
taskStats.memoryReclaimMs * 1'000'000,
RuntimeCounter::Unit::kNanos)});
}

if (taskStats.endTimeMs >= taskStats.executionEndTimeMs) {
taskRuntimeStats["outputConsumedDelayInNanos"].addValue(
(taskStats.endTimeMs - taskStats.executionEndTimeMs) * 1'000'000);
taskRuntimeStats.insert(
{"outputConsumedDelayInNanos",
RuntimeMetric(
(taskStats.endTimeMs - taskStats.executionEndTimeMs) * 1'000'000,
RuntimeCounter::Unit::kNanos)});
taskRuntimeStats["createTime"].addValue(taskStats.executionStartTimeMs);
taskRuntimeStats["endTime"].addValue(taskStats.endTimeMs);
}
Expand Down