mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
bursty cycle rate test online
This commit is contained in:
@@ -81,9 +81,16 @@ public class SimRate extends NBBaseComponent implements RateLimiter, Thread.Unca
|
||||
public SimRate(NBComponent parent, SimRateSpec spec) {
|
||||
super(parent, NBLabels.forKV());
|
||||
this.spec = spec;
|
||||
initMetrics();
|
||||
startFiller();
|
||||
}
|
||||
|
||||
private void initMetrics() {
|
||||
create().gauge("cycles_waittime",() -> (double)getWaitTimeDuration().get(ChronoUnit.NANOS));
|
||||
create().gauge("_config_cyclerate", () -> spec.opsPerSec);
|
||||
create().gauge("_config_burstrate", () -> spec.burstRatio);
|
||||
}
|
||||
|
||||
public long refill() {
|
||||
try {
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ public class SimpleActivity extends NBBaseComponent implements Activity {
|
||||
|
||||
@Override
|
||||
public synchronized void initActivity() {
|
||||
// initOrUpdateRateLimiters(this.activityDef);
|
||||
initOrUpdateRateLimiters(this.activityDef);
|
||||
}
|
||||
|
||||
public synchronized NBErrorHandler getErrorHandler() {
|
||||
@@ -307,7 +307,6 @@ public class SimpleActivity extends NBBaseComponent implements Activity {
|
||||
|
||||
public synchronized void initOrUpdateRateLimiters(ActivityDef activityDef) {
|
||||
|
||||
|
||||
activityDef.getParams().getOptionalNamedParameter("striderate")
|
||||
.map(StrideRateSpec::new).ifPresent(sr -> this.onEvent(new ParamChange<>(sr)));
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ScriptEnvBuffer extends SimpleScriptContext {
|
||||
synchronized(this) {
|
||||
if (stdoutBuffer==null) {
|
||||
Writer superWriter = super.getWriter();
|
||||
stdoutBuffer = new DiagWriter(superWriter, new InterjectingCharArrayWriter(" stdout "));
|
||||
stdoutBuffer = new DiagWriter(new InterjectingCharArrayWriter(" stdout "),superWriter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class ScriptEnvBuffer extends SimpleScriptContext {
|
||||
synchronized(this) {
|
||||
if (stderrBuffer==null) {
|
||||
Writer superErrorWriter = super.getErrorWriter();
|
||||
stderrBuffer = new DiagWriter(superErrorWriter, new InterjectingCharArrayWriter(" stderr "));
|
||||
stderrBuffer = new DiagWriter(new InterjectingCharArrayWriter(" stderr "),superErrorWriter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user