fix total task exec time is far more than actual (#31279)

This commit is contained in:
HHoflittlefish777
2024-02-22 21:59:02 +08:00
committed by yiguolei
parent 18f9ca9242
commit e56fe682c9
2 changed files with 6 additions and 7 deletions

View File

@ -792,17 +792,16 @@ public abstract class RoutineLoadJob extends AbstractTxnStateChangeCallback impl
// if rate of error data is more than max_filter_ratio, pause job
protected void updateProgress(RLTaskTxnCommitAttachment attachment) throws UserException {
updateNumOfData(attachment.getTotalRows(), attachment.getFilteredRows(), attachment.getUnselectedRows(),
attachment.getReceivedBytes(), attachment.getTaskExecutionTimeMs(),
false /* not replay */);
attachment.getReceivedBytes(), false /* not replay */);
}
private void updateNumOfData(long numOfTotalRows, long numOfErrorRows, long unselectedRows, long receivedBytes,
long taskExecutionTime, boolean isReplay) throws UserException {
boolean isReplay) throws UserException {
this.jobStatistic.totalRows += numOfTotalRows;
this.jobStatistic.errorRows += numOfErrorRows;
this.jobStatistic.unselectedRows += unselectedRows;
this.jobStatistic.receivedBytes += receivedBytes;
this.jobStatistic.totalTaskExcutionTimeMs += taskExecutionTime;
this.jobStatistic.totalTaskExcutionTimeMs = System.currentTimeMillis() - createTimestamp;
if (MetricRepo.isInit && !isReplay) {
MetricRepo.COUNTER_ROUTINE_LOAD_ROWS.increase(numOfTotalRows);
@ -875,7 +874,7 @@ public abstract class RoutineLoadJob extends AbstractTxnStateChangeCallback impl
protected void replayUpdateProgress(RLTaskTxnCommitAttachment attachment) {
try {
updateNumOfData(attachment.getTotalRows(), attachment.getFilteredRows(), attachment.getUnselectedRows(),
attachment.getReceivedBytes(), attachment.getTaskExecutionTimeMs(), true /* is replay */);
attachment.getReceivedBytes(), true /* is replay */);
} catch (UserException e) {
LOG.error("should not happen", e);
}