Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ final class AggregateEntry extends Hashtable.Entry {
private int errorCount;
private int hitCount;
private int topLevelCount;
private long duration;
private long okDuration;
private long errorDuration;

/**
* Field-bearing constructor. Package-private so {@link AggregateEntryTestUtils} can build
Expand Down Expand Up @@ -155,11 +156,12 @@ AggregateEntry recordOneDuration(long tagAndDuration) {
if ((tagAndDuration & ERROR_TAG) == ERROR_TAG) {
tagAndDuration ^= ERROR_TAG;
errorLatenciesForWrite().accept(tagAndDuration);
errorDuration += tagAndDuration;
++errorCount;
} else {
okLatencies.accept(tagAndDuration);
okDuration += tagAndDuration;
}
duration += tagAndDuration;
return this;
}

Expand All @@ -176,7 +178,15 @@ int getTopLevelCount() {
}

long getDuration() {
return duration;
return okDuration + errorDuration;
}

long getOkDuration() {
return okDuration;
}

long getErrorDuration() {
return errorDuration;
}

Histogram getOkLatencies() {
Expand Down Expand Up @@ -214,7 +224,8 @@ void clear() {
this.errorCount = 0;
this.hitCount = 0;
this.topLevelCount = 0;
this.duration = 0;
this.okDuration = 0;
this.errorDuration = 0;
this.okLatencies.clear();
// errorLatencies stays null on entries that never errored. Only clear if it was allocated.
if (this.errorLatencies != null) {
Expand Down