Skip to content
Permalink
Browse files
fix message_stat not reset each superstep (#131)
  • Loading branch information
javeme committed Oct 28, 2021
1 parent af865d9 commit b8db9f8f0dca6ff0316c2c4dca4fc8ddc8cbcba9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
@@ -140,6 +140,7 @@ public void sendMessage(Id targetId, Value<?> value) {
*/
public void startSend(MessageType type) {
Map<Integer, WriteBuffers> all = this.buffers.all();
all.values().stream().forEach(WriteBuffers::resetMessageWritten);
Set<Integer> workerIds = all.keySet().stream()
.map(this.partitioner::workerId)
.collect(Collectors.toSet());
@@ -66,6 +66,11 @@ public boolean isEmpty() {
return this.writingBuffer.isEmpty();
}

public void resetMessageWritten() {
this.totalCount = 0L;
this.totalBytes = 0L;
}

public MessageStat messageWritten() {
return new MessageStat(this.totalCount, this.totalBytes);
}

0 comments on commit b8db9f8

Please sign in to comment.