Skip to content

Commit

Permalink
perf: 主机与主机关系事件处理优化 TencentBlueKing#1145
Browse files Browse the repository at this point in the history
优化日志。
  • Loading branch information
jsonwan committed Sep 1, 2022
1 parent 4bf8e8f commit 7b26bc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public HostRelationWatchThread(DSLContext dslContext,
this.hostCache = hostCache;
this.setName("[" + getId() + "]-HostRelationWatchThread-" + instanceNum.getAndIncrement());
this.eventsHandler = buildHostRelationEventsHandler();
this.eventsHandler.setName("[" + eventsHandler.getId() + "]-HostRelationEventsHandler");
}

private HostRelationEventsHandler buildHostRelationEventsHandler() {
Expand Down Expand Up @@ -137,7 +138,7 @@ public String handleHostRelationWatchResult(ResourceWatchResult<HostRelationEven
dispatchEvent(event);
}
if (events.size() > 0) {
log.info("events.size={},events={}", events.size(), JsonUtils.toJson(events));
log.info("events.size={}", events.size());
cursor = events.get(events.size() - 1).getCursor();
} else {
log.warn("Unexpected:events.size==0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public HostWatchThread(DSLContext dslContext,
this.hostCache = hostCache;
this.setName("[" + getId() + "]-HostWatchThread-" + instanceNum.getAndIncrement());
this.eventsHandler = buildHostEventsHandler();
this.eventsHandler.setName("[" + eventsHandler.getId() + "]-HostEventsHandler");
}

private HostEventsHandler buildHostEventsHandler() {
Expand Down Expand Up @@ -133,7 +134,7 @@ public String handleHostWatchResult(ResourceWatchResult<HostEventDetail> hostWat
dispatchEvent(event);
}
if (events.size() > 0) {
log.info("events.size={},events={}", events.size(), JsonUtils.toJson(events));
log.info("events.size={}", events.size());
cursor = events.get(events.size() - 1).getCursor();
log.info("refresh cursor(success):{}", cursor);
} else {
Expand Down

0 comments on commit 7b26bc4

Please sign in to comment.