chore(日志): 服务端高频轮询日志降噪
-history timing 降debug;status无变化降debug;/history /list免INFO;stale-check合并单行;心跳常规响应降debug
This commit is contained in:
+10
-4
@@ -207,7 +207,7 @@ public class PriceTrackTaskService {
|
||||
long resultRowsLoadedAt = System.nanoTime();
|
||||
if (entities.isEmpty()) {
|
||||
vo.setItems(List.of());
|
||||
log.info("[price-track] history timing userId={} rows=0 totalMs={} resultQueryMs={} taskQueryMs=0 jobQueryMs=0 buildMs=0",
|
||||
log.debug("[price-track] history timing userId={} rows=0 totalMs={} resultQueryMs={} taskQueryMs=0 jobQueryMs=0 buildMs=0",
|
||||
userId, elapsedMs(startedAt, resultRowsLoadedAt), elapsedMs(startedAt, resultRowsLoadedAt));
|
||||
return vo;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ public class PriceTrackTaskService {
|
||||
}
|
||||
vo.setItems(items);
|
||||
long finishedAt = System.nanoTime();
|
||||
log.info("[price-track] history timing userId={} rows={} tasks={} jobs={} totalMs={} resultQueryMs={} taskQueryMs={} jobQueryMs={} buildMs={}",
|
||||
log.debug("[price-track] history timing userId={} rows={} tasks={} jobs={} totalMs={} resultQueryMs={} taskQueryMs={} jobQueryMs={} buildMs={}",
|
||||
userId,
|
||||
entities.size(),
|
||||
taskById.size(),
|
||||
@@ -2130,8 +2130,14 @@ public class PriceTrackTaskService {
|
||||
log.warn("[price-track] compact result json failed: {}", ex.getMessage());
|
||||
}
|
||||
fileTaskMapper.updateById(task);
|
||||
log.warn("[price-track] status updated from latest rows taskId={} oldStatus={} newStatus={} ok={} fail={} allDone={} errorMessage={}",
|
||||
task.getId(), oldStatus, task.getStatus(), ok, fail, allDone, task.getErrorMessage());
|
||||
// 轮询期间可能频繁触发状态回写:无变化且无失败时降为 debug,避免刷屏
|
||||
if (!oldStatus.equals(task.getStatus()) || ok > 0 || fail > 0 || task.getErrorMessage() != null) {
|
||||
log.info("[price-track] status updated taskId={} oldStatus={} newStatus={} ok={} fail={} allDone={} errorMessage={}",
|
||||
task.getId(), oldStatus, task.getStatus(), ok, fail, allDone, task.getErrorMessage());
|
||||
} else {
|
||||
log.debug("[price-track] status unchanged taskId={} status={} ok={} fail={}",
|
||||
task.getId(), task.getStatus(), ok, fail);
|
||||
}
|
||||
cleanupTaskCacheIfTerminal(task.getId(), task.getStatus());
|
||||
if ("SUCCESS".equals(task.getStatus()) || "FAILED".equals(task.getStatus())) {
|
||||
priceTrackLoopRunService.syncLoopRunAfterChildTerminal(task.getId());
|
||||
|
||||
Reference in New Issue
Block a user