mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
minor fix for sampling window test stability
This commit is contained in:
parent
b50cb7f87a
commit
a1445927b9
@ -58,7 +58,7 @@ public final class FrameSample {
|
|||||||
if (active) {
|
if (active) {
|
||||||
this.endAt = endTime;
|
this.endAt = endTime;
|
||||||
this.endval = (criterion().evaltype() != EvalType.remix) ? criterion().supplier().getAsDouble() : Double.NaN;
|
this.endval = (criterion().evaltype() != EvalType.remix) ? criterion().supplier().getAsDouble() : Double.NaN;
|
||||||
calculateBasis();
|
calculateBasis(endTime);
|
||||||
this.active = false;
|
this.active = false;
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Can't stop an inactive frame.");
|
throw new RuntimeException("Can't stop an inactive frame.");
|
||||||
@ -67,10 +67,14 @@ public final class FrameSample {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void calculateBasis() {
|
private void calculateBasis() {
|
||||||
|
calculateBasis(System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void calculateBasis(long now) {
|
||||||
if (!active) {
|
if (!active) {
|
||||||
throw new RuntimeException("Calculations on inactive windows should not be done.");
|
throw new RuntimeException("Calculations on inactive windows should not be done.");
|
||||||
}
|
}
|
||||||
this.endAt = System.currentTimeMillis();
|
this.endAt = now;
|
||||||
this.endval = (criterion().evaltype() != EvalType.remix) ? criterion().supplier().getAsDouble() : Double.NaN;
|
this.endval = (criterion().evaltype() != EvalType.remix) ? criterion().supplier().getAsDouble() : Double.NaN;
|
||||||
double seconds = deltaT();
|
double seconds = deltaT();
|
||||||
double basis = switch (criterion.evaltype()) {
|
double basis = switch (criterion.evaltype()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user