mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-12-01 21:09:18 -06:00
calculate session duration automatically for annotations
This commit is contained in:
parent
255a560957
commit
5e52ff2031
@ -96,4 +96,8 @@ public interface Annotation extends NBLabeledElement {
|
||||
|
||||
String asJson();
|
||||
|
||||
default long getDurationMillis() {
|
||||
return getEndMillis()-getStartMillis();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ public class MutableAnnotation implements Annotation {
|
||||
|
||||
public void setEnd(long intervalEnd) {
|
||||
this.end = intervalEnd;
|
||||
this.details.put("duration",String.valueOf(getDurationMillis()));
|
||||
}
|
||||
|
||||
public void setLayer(Layer layer) {
|
||||
@ -136,8 +137,8 @@ public class MutableAnnotation implements Annotation {
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
ZonedDateTime startTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(getStart()), zoneid);
|
||||
ZonedDateTime endTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(getStart()), zoneid);
|
||||
ZonedDateTime startTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(getStartMillis()), zoneid);
|
||||
ZonedDateTime endTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(getStartMillis()), zoneid);
|
||||
|
||||
sb.append("[");
|
||||
ZonedDateTime zonedStartTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(getStart()), zoneid);
|
||||
|
Loading…
Reference in New Issue
Block a user