mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
disable sysperf and extra tests
This commit is contained in:
parent
607fdc58c9
commit
ecf1fa5afd
@ -25,8 +25,14 @@ import java.util.concurrent.locks.LockSupport;
|
||||
public class LeastWorstDelay {
|
||||
|
||||
public final static SysPerfData perfdata = SysPerf.get().getPerfData(false);
|
||||
private final static long sleepThreshold = (long) perfdata.getAvgNanos_Thread_Sleep();
|
||||
private final static long parkThreshold = (long) perfdata.getAvgNanos_LockSupport_ParkNanos();
|
||||
|
||||
//private final static long sleepThreshold = (long) perfdata
|
||||
//.getAvgNanos_Thread_Sleep();
|
||||
//private final static long parkThreshold = (long) perfdata
|
||||
//.getAvgNanos_LockSupport_ParkNanos();
|
||||
|
||||
private final static long sleepThreshold = 1_000_000;
|
||||
private final static long parkThreshold = 20;
|
||||
|
||||
/**
|
||||
* We wish for the JVM to inline this.
|
||||
@ -87,7 +93,6 @@ public class LeastWorstDelay {
|
||||
*
|
||||
* @param targetNanoTime The system nanos that the delay should attempt to return at.
|
||||
* perfect accuracy, which doesn't happen
|
||||
*
|
||||
*/
|
||||
public void delayAsIfUntil(long targetNanoTime) {
|
||||
long nanos = Math.max(targetNanoTime - System.nanoTime(), 0L);
|
||||
|
@ -18,8 +18,6 @@
|
||||
package io.nosqlbench.engine.api.activityapi.ratelimits;
|
||||
|
||||
import com.codahale.metrics.Timer;
|
||||
import io.nosqlbench.engine.api.activityapi.sysperf.SysPerf;
|
||||
import io.nosqlbench.engine.api.activityapi.sysperf.SysPerfData;
|
||||
import io.nosqlbench.engine.api.activityimpl.ActivityDef;
|
||||
import io.nosqlbench.engine.api.metrics.ActivityMetrics;
|
||||
import org.slf4j.Logger;
|
||||
@ -33,7 +31,8 @@ public class TokenFiller implements Runnable {
|
||||
|
||||
public final static double MIN_PER_SECOND = 10D;
|
||||
public final static double MAX_PER_SECOND = 1000D;
|
||||
private final SysPerfData PERFDATA = SysPerf.get().getPerfData(false);
|
||||
// private final SysPerfData PERFDATA = SysPerf.get().getPerfData
|
||||
// (false);
|
||||
private final long interval = (long) 1E6;
|
||||
|
||||
private final TokenPool tokenPool;
|
||||
|
@ -41,10 +41,12 @@ public class SysPerf {
|
||||
}
|
||||
|
||||
public synchronized static SysPerf get() {
|
||||
if (instance == null) {
|
||||
instance = new SysPerf();
|
||||
}
|
||||
return instance;
|
||||
throw new RuntimeException("This should not be used in this " +
|
||||
"release.");
|
||||
// if (instance == null) {
|
||||
// instance = new SysPerf();
|
||||
// }
|
||||
// return instance;
|
||||
}
|
||||
|
||||
private static File getPerfCacheFile() {
|
||||
|
@ -24,15 +24,10 @@ import org.assertj.core.data.Offset;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@ -85,180 +80,185 @@ public class ScriptIntegrationTests {
|
||||
assertThat(rate).isCloseTo(1000, Offset.offset(100.0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStrideRateOnly() {
|
||||
ScenarioResult scenarioResult = runScenario("stride_rate");
|
||||
String iolog = scenarioResult.getIOLog();
|
||||
System.out.println("iolog\n" + iolog);
|
||||
Pattern p = Pattern.compile(".*stride_rate.strides.servicetime.meanRate = (\\d[.\\d]+).*", Pattern.DOTALL);
|
||||
Matcher m = p.matcher(iolog);
|
||||
assertThat(m.matches()).isTrue();
|
||||
// The tests below are being disabled and eventually removed.
|
||||
// The async versions are higher sensitivity and equivalent in
|
||||
// every other way.
|
||||
// This should reduce the build time for integrated testing.
|
||||
|
||||
String digits = m.group(1);
|
||||
assertThat(digits).isNotEmpty();
|
||||
double rate = Double.valueOf(digits);
|
||||
assertThat(rate).isCloseTo(10000.0D, Offset.offset(1000D));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPhaseRateOnly() {
|
||||
ScenarioResult scenarioResult = runScenario("phase_rate");
|
||||
String iolog = scenarioResult.getIOLog();
|
||||
System.out.println("iolog\n" + iolog);
|
||||
Pattern p = Pattern.compile(".*phase_rate.phases.servicetime.meanRate = (\\d[.\\d]+).*", Pattern.DOTALL);
|
||||
Matcher m = p.matcher(iolog);
|
||||
assertThat(m.matches()).isTrue();
|
||||
|
||||
String digits = m.group(1);
|
||||
assertThat(digits).isNotEmpty();
|
||||
double rate = Double.valueOf(digits);
|
||||
assertThat(rate).isCloseTo(25000.0D, Offset.offset(5000D));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testExtensionPoint() {
|
||||
ScenarioResult scenarioResult = runScenario("extensions");
|
||||
assertThat(scenarioResult.getIOLog()).contains("sum is 46");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLinkedInput() {
|
||||
ScenarioResult scenarioResult = runScenario("linkedinput");
|
||||
Pattern p = Pattern.compile(".*started leader.*started follower.*stopped leader.*stopped follower.*",
|
||||
Pattern.DOTALL);
|
||||
assertThat(p.matcher(scenarioResult.getIOLog()).matches()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtensionCsvLogger() {
|
||||
ScenarioResult scenarioResult = runScenario("extension_csvmetrics");
|
||||
assertThat(scenarioResult.getIOLog()).contains("started new " +
|
||||
"csvlogger: logs/csvmetricstestdir");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testScriptParamsVariable() {
|
||||
ScenarioResult scenarioResult = runScenario("params_variable", "one", "two", "three", "four");
|
||||
assertThat(scenarioResult.getIOLog()).contains("params.get(\"one\")='two'");
|
||||
assertThat(scenarioResult.getIOLog()).contains("params.get(\"three\")='four'");
|
||||
assertThat(scenarioResult.getIOLog()).contains("params.size()=2");
|
||||
assertThat(scenarioResult.getIOLog()).contains("params.get(\"three\") [overridden-three-five]='five'");
|
||||
assertThat(scenarioResult.getIOLog()).contains("params.get(\"four\") [defaulted-four-niner]='niner'");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtensionHistoStatsLogger() throws IOException {
|
||||
ScenarioResult scenarioResult = runScenario("extension_histostatslogger");
|
||||
assertThat(scenarioResult.getIOLog()).contains("stdout started " +
|
||||
"logging to logs/histostats.csv");
|
||||
List<String> strings = Files.readAllLines(Paths.get(
|
||||
"logs/histostats.csv"));
|
||||
String logdata = strings.stream().collect(Collectors.joining("\n"));
|
||||
assertThat(logdata).contains("min,p25,p50,p75,p90,p95,");
|
||||
assertThat(logdata.split("Tag=testhistostatslogger.cycles.servicetime,").length).isGreaterThanOrEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtensionHistogramLogger() throws IOException {
|
||||
ScenarioResult scenarioResult = runScenario("extension_histologger");
|
||||
assertThat(scenarioResult.getIOLog()).contains("stdout started logging to hdrhistodata.log");
|
||||
List<String> strings = Files.readAllLines(Paths.get("hdrhistodata.log"));
|
||||
String logdata = strings.stream().collect(Collectors.joining("\n"));
|
||||
assertThat(logdata).contains(",HIST");
|
||||
assertThat(logdata.split("Tag=testhistologger.cycles.servicetime,").length).isGreaterThanOrEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlockingRun() {
|
||||
ScenarioResult scenarioResult = runScenario("blockingrun");
|
||||
int a1end = scenarioResult.getIOLog().indexOf("blockingactivity1 finished");
|
||||
int a2start = scenarioResult.getIOLog().indexOf("running blockingactivity2");
|
||||
assertThat(a1end).isLessThan(a2start);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAwaitFinished() {
|
||||
ScenarioResult scenarioResult = runScenario("awaitfinished");
|
||||
scenarioResult.reportToLog();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStartStop() {
|
||||
ScenarioResult scenarioResult = runScenario("startstopdiag");
|
||||
scenarioResult.reportToLog();
|
||||
int startedAt = scenarioResult.getIOLog().indexOf("starting activity teststartstopdiag");
|
||||
int stoppedAt = scenarioResult.getIOLog().indexOf("stopped activity teststartstopdiag");
|
||||
assertThat(startedAt).isGreaterThan(0);
|
||||
assertThat(stoppedAt).isGreaterThan(startedAt);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testThreadChange() {
|
||||
ScenarioResult scenarioResult = runScenario("threadchange");
|
||||
int changedTo1At = scenarioResult.getIOLog().indexOf("threads now 1");
|
||||
int changedTo5At = scenarioResult.getIOLog().indexOf("threads now 5");
|
||||
assertThat(changedTo1At).isGreaterThan(0);
|
||||
assertThat(changedTo5At).isGreaterThan(changedTo1At);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReadMetric() {
|
||||
ScenarioResult scenarioResult = runScenario("readmetrics");
|
||||
assertThat(scenarioResult.getIOLog()).contains("count: ");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExceptionPropagationFromMotorThread() {
|
||||
ScenarioResult scenarioResult = runScenario("activityerror");
|
||||
assertThat(scenarioResult.getException()).isPresent();
|
||||
assertThat(scenarioResult.getException().get().getMessage()).contains("For input string: \"unparsable\"");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExceptionPropagationFromActivityInit() {
|
||||
ScenarioResult scenarioResult = runScenario("activityiniterror");
|
||||
assertThat(scenarioResult.getException()).isPresent();
|
||||
assertThat(scenarioResult.getException().get().getMessage()).contains("For input string: \"unparsable\"");
|
||||
assertThat(scenarioResult.getException()).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReportedCoDelayBursty() {
|
||||
ScenarioResult scenarioResult = runScenario("cocycledelay_bursty");
|
||||
assertThat(scenarioResult.getIOLog()).contains("step1 metrics.waittime=");
|
||||
assertThat(scenarioResult.getIOLog()).contains("step2 metrics.waittime=");
|
||||
String iolog = scenarioResult.getIOLog();
|
||||
System.out.println(iolog);
|
||||
assertThat(iolog).contains("waittime trended back down as expected");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReportedCoDelayStrict() {
|
||||
ScenarioResult scenarioResult = runScenario("cocycledelay_strict");
|
||||
assertThat(scenarioResult.getIOLog()).contains("step1 cycles.waittime=");
|
||||
assertThat(scenarioResult.getIOLog()).contains("step2 cycles.waittime=");
|
||||
String iolog = scenarioResult.getIOLog();
|
||||
System.out.println(iolog);
|
||||
// TODO: ensure that waittime is staying the same or increasing
|
||||
// after investigating minor decreasing effect
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCycleRateChange() {
|
||||
ScenarioResult scenarioResult = runScenario("cycle_rate_change");
|
||||
String ioLog = scenarioResult.getIOLog();
|
||||
assertThat(ioLog).contains("cycles adjusted, exiting on iteration");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExitLogic() {
|
||||
ScenarioResult scenarioResult = runScenario(
|
||||
"basicdiag",
|
||||
"type", "diag", "cyclerate", "5", "erroroncycle", "10", "cycles", "2000"
|
||||
);
|
||||
}
|
||||
// @Test
|
||||
// public void testStrideRateOnly() {
|
||||
// ScenarioResult scenarioResult = runScenario("stride_rate");
|
||||
// String iolog = scenarioResult.getIOLog();
|
||||
// System.out.println("iolog\n" + iolog);
|
||||
// Pattern p = Pattern.compile(".*stride_rate.strides.servicetime.meanRate = (\\d[.\\d]+).*", Pattern.DOTALL);
|
||||
// Matcher m = p.matcher(iolog);
|
||||
// assertThat(m.matches()).isTrue();
|
||||
//
|
||||
// String digits = m.group(1);
|
||||
// assertThat(digits).isNotEmpty();
|
||||
// double rate = Double.valueOf(digits);
|
||||
// assertThat(rate).isCloseTo(10000.0D, Offset.offset(1000D));
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testPhaseRateOnly() {
|
||||
// ScenarioResult scenarioResult = runScenario("phase_rate");
|
||||
// String iolog = scenarioResult.getIOLog();
|
||||
// System.out.println("iolog\n" + iolog);
|
||||
// Pattern p = Pattern.compile(".*phase_rate.phases.servicetime.meanRate = (\\d[.\\d]+).*", Pattern.DOTALL);
|
||||
// Matcher m = p.matcher(iolog);
|
||||
// assertThat(m.matches()).isTrue();
|
||||
//
|
||||
// String digits = m.group(1);
|
||||
// assertThat(digits).isNotEmpty();
|
||||
// double rate = Double.valueOf(digits);
|
||||
// assertThat(rate).isCloseTo(25000.0D, Offset.offset(5000D));
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Test
|
||||
// public void testExtensionPoint() {
|
||||
// ScenarioResult scenarioResult = runScenario("extensions");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("sum is 46");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testLinkedInput() {
|
||||
// ScenarioResult scenarioResult = runScenario("linkedinput");
|
||||
// Pattern p = Pattern.compile(".*started leader.*started follower.*stopped leader.*stopped follower.*",
|
||||
// Pattern.DOTALL);
|
||||
// assertThat(p.matcher(scenarioResult.getIOLog()).matches()).isTrue();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testExtensionCsvLogger() {
|
||||
// ScenarioResult scenarioResult = runScenario("extension_csvmetrics");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("started new " +
|
||||
// "csvlogger: logs/csvmetricstestdir");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Test
|
||||
// public void testScriptParamsVariable() {
|
||||
// ScenarioResult scenarioResult = runScenario("params_variable", "one", "two", "three", "four");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"one\")='two'");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"three\")='four'");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("params.size()=2");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"three\") [overridden-three-five]='five'");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("params.get(\"four\") [defaulted-four-niner]='niner'");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testExtensionHistoStatsLogger() throws IOException {
|
||||
// ScenarioResult scenarioResult = runScenario("extension_histostatslogger");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("stdout started " +
|
||||
// "logging to logs/histostats.csv");
|
||||
// List<String> strings = Files.readAllLines(Paths.get(
|
||||
// "logs/histostats.csv"));
|
||||
// String logdata = strings.stream().collect(Collectors.joining("\n"));
|
||||
// assertThat(logdata).contains("min,p25,p50,p75,p90,p95,");
|
||||
// assertThat(logdata.split("Tag=testhistostatslogger.cycles.servicetime,").length).isGreaterThanOrEqualTo(3);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testExtensionHistogramLogger() throws IOException {
|
||||
// ScenarioResult scenarioResult = runScenario("extension_histologger");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("stdout started logging to hdrhistodata.log");
|
||||
// List<String> strings = Files.readAllLines(Paths.get("hdrhistodata.log"));
|
||||
// String logdata = strings.stream().collect(Collectors.joining("\n"));
|
||||
// assertThat(logdata).contains(",HIST");
|
||||
// assertThat(logdata.split("Tag=testhistologger.cycles.servicetime,").length).isGreaterThanOrEqualTo(3);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testBlockingRun() {
|
||||
// ScenarioResult scenarioResult = runScenario("blockingrun");
|
||||
// int a1end = scenarioResult.getIOLog().indexOf("blockingactivity1 finished");
|
||||
// int a2start = scenarioResult.getIOLog().indexOf("running blockingactivity2");
|
||||
// assertThat(a1end).isLessThan(a2start);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testAwaitFinished() {
|
||||
// ScenarioResult scenarioResult = runScenario("awaitfinished");
|
||||
// scenarioResult.reportToLog();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testStartStop() {
|
||||
// ScenarioResult scenarioResult = runScenario("startstopdiag");
|
||||
// scenarioResult.reportToLog();
|
||||
// int startedAt = scenarioResult.getIOLog().indexOf("starting activity teststartstopdiag");
|
||||
// int stoppedAt = scenarioResult.getIOLog().indexOf("stopped activity teststartstopdiag");
|
||||
// assertThat(startedAt).isGreaterThan(0);
|
||||
// assertThat(stoppedAt).isGreaterThan(startedAt);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testThreadChange() {
|
||||
// ScenarioResult scenarioResult = runScenario("threadchange");
|
||||
// int changedTo1At = scenarioResult.getIOLog().indexOf("threads now 1");
|
||||
// int changedTo5At = scenarioResult.getIOLog().indexOf("threads now 5");
|
||||
// assertThat(changedTo1At).isGreaterThan(0);
|
||||
// assertThat(changedTo5At).isGreaterThan(changedTo1At);
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testReadMetric() {
|
||||
// ScenarioResult scenarioResult = runScenario("readmetrics");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("count: ");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testExceptionPropagationFromMotorThread() {
|
||||
// ScenarioResult scenarioResult = runScenario("activityerror");
|
||||
// assertThat(scenarioResult.getException()).isPresent();
|
||||
// assertThat(scenarioResult.getException().get().getMessage()).contains("For input string: \"unparsable\"");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testExceptionPropagationFromActivityInit() {
|
||||
// ScenarioResult scenarioResult = runScenario("activityiniterror");
|
||||
// assertThat(scenarioResult.getException()).isPresent();
|
||||
// assertThat(scenarioResult.getException().get().getMessage()).contains("For input string: \"unparsable\"");
|
||||
// assertThat(scenarioResult.getException()).isNotNull();
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testReportedCoDelayBursty() {
|
||||
// ScenarioResult scenarioResult = runScenario("cocycledelay_bursty");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("step1 metrics.waittime=");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("step2 metrics.waittime=");
|
||||
// String iolog = scenarioResult.getIOLog();
|
||||
// System.out.println(iolog);
|
||||
// assertThat(iolog).contains("waittime trended back down as expected");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testReportedCoDelayStrict() {
|
||||
// ScenarioResult scenarioResult = runScenario("cocycledelay_strict");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("step1 cycles.waittime=");
|
||||
// assertThat(scenarioResult.getIOLog()).contains("step2 cycles.waittime=");
|
||||
// String iolog = scenarioResult.getIOLog();
|
||||
// System.out.println(iolog);
|
||||
// // TODO: ensure that waittime is staying the same or increasing
|
||||
// // after investigating minor decreasing effect
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @Test
|
||||
// public void testCycleRateChange() {
|
||||
// ScenarioResult scenarioResult = runScenario("cycle_rate_change");
|
||||
// String ioLog = scenarioResult.getIOLog();
|
||||
// assertThat(ioLog).contains("cycles adjusted, exiting on iteration");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// public void testExitLogic() {
|
||||
// ScenarioResult scenarioResult = runScenario(
|
||||
// "basicdiag",
|
||||
// "type", "diag", "cyclerate", "5", "erroroncycle", "10", "cycles", "2000"
|
||||
// );
|
||||
// }
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user