Skip to content

Commit 6732f41

Browse files
committed
[native] Add runtime stats taskCreationTime
1 parent 4936390 commit 6732f41

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

presto-native-execution/presto_cpp/main/PrestoTask.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ void PrestoTask::updateTimeInfoLocked(
769769
taskRuntimeStats["endTime"].addValue(veloxTaskStats.endTimeMs);
770770
}
771771
taskRuntimeStats.insert({"nativeProcessCpuTime", fromNanos(processCpuTime_)});
772+
taskRuntimeStats.insert({"taskCreationTime", fromNanos((createFinishTimeMs - createTimeMs) * 1'000'000)});
772773
}
773774

774775
void PrestoTask::updateMemoryInfoLocked(

presto-native-execution/presto_cpp/main/PrestoTask.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ struct PrestoTask {
121121
uint64_t lastTaskStatsUpdateMs{0};
122122

123123
uint64_t lastMemoryReservation{0};
124+
/// Time point (in ms) when the time we start task creating.
124125
uint64_t createTimeMs{0};
126+
/// Time point (in ms) when the time we finish task creating.
127+
uint64_t createFinishTimeMs{0};
125128
uint64_t startTimeMs{0};
126129
uint64_t firstSplitStartTimeMs{0};
127130
uint64_t lastEndTimeMs{0};

presto-native-execution/presto_cpp/main/TaskManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ std::unique_ptr<TaskInfo> TaskManager::createOrUpdateTaskImpl(
576576
}
577577
execTask = prestoTask->task;
578578
}
579+
prestoTask->createFinishTimeMs = getCurrentTimeMs();
579580
// Outside of prestoTask->mutex.
580581
VELOX_CHECK_NOT_NULL(
581582
execTask,

0 commit comments

Comments
 (0)