Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit 37b6c25

Browse files
Merge pull request #299 from mwws/streaming
correct negative value
2 parents fe8b4ac + 466e267 commit 37b6c25

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/streambench/common/src/main/scala/com/intel/hibench/streambench/common/metrics

src/streambench/common/src/main/scala/com/intel/hibench/streambench/common/metrics/FetchJob.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class FetchJob(zkConnect: String, topic: String, partition: Int,
3131
val times = new String(consumer.next(), "UTF-8").split(":")
3232
val startTime = times(0).toLong
3333
val endTime = times(1).toLong
34-
histogram.update(endTime - startTime)
34+
// correct negative value which might be caused by difference of system time
35+
histogram.update(Math.max(0, endTime - startTime))
3536
result.update(startTime, endTime)
3637
}
3738
println(s"Collected ${result.count} results for partition: ${partition}")

0 commit comments

Comments
 (0)