eclipse-ee4j / eclipse-ee4j/jersey
Please double check your tracing statistic logic
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
In TracingInfo:
for (int i = 0; i < messages.length; i++) {
final Message message = messageList.get(i);
final StringBuilder textSB = new StringBuilder();
// event
textSB.append(String.format("%-11s ", message.getEvent().category()));
// duration
textSB.append('[')
.append(formatDuration(message.getDuration()))
.append(" / ")
.append(formatDuration(fromTimestamp, message.getTimestamp()))
.append(" ms |")
.append(formatPercent(message.getDuration(), toTimestamp - fromTimestamp))
.append(" %] ");
// text
textSB.append(message.toString());
messages[i] = textSB.toString();
}
This logic is actually not correct.
Since your message time measurement is in sequence.
Some message are summary message which wrap others.
So, startTime is not reliable:
` final long fromTimestamp = messageList.get(0).getTimestamp() - messageList.get(0).getDuration();`
Say we have time sequences:
t1, t2, t3, t4
You might use (t3-t2) as first message and (t4-t1) as the second one.
In this case, t2 is not the very start time.
Thanks
Leon
Contributor guide
Assessment
This issue has not been assessed yet.