AbstractMicrobenchmarkBase Class — netty Architecture
Architecture documentation for the AbstractMicrobenchmarkBase class in AbstractMicrobenchmarkBase.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 9778b63c_6178_7689_7f4b_f7e25a1383ca["AbstractMicrobenchmarkBase"] df7e8701_5c2b_9273_cd56_cec94d4dcd36["AbstractMicrobenchmarkBase.java"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|defined in| df7e8701_5c2b_9273_cd56_cec94d4dcd36 ff4cfec4_d4e6_3209_4371_5ca3d099614b["ChainedOptionsBuilder()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| ff4cfec4_d4e6_3209_4371_5ca3d099614b 0c7888a3_01c7_c1f9_1e3d_2e4dd80bbef7["jvmArgs()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| 0c7888a3_01c7_c1f9_1e3d_2e4dd80bbef7 3adfa809_f4d5_907a_c5f2_0166d67537c1["removeAssertions()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| 3adfa809_f4d5_907a_c5f2_0166d67537c1 d2acac03_9e00_b0cb_50ea_76962001d33b["run()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| d2acac03_9e00_b0cb_50ea_76962001d33b 1c187ea3_0c65_91c4_84c3_eb147d95771e["getWarmupIterations()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| 1c187ea3_0c65_91c4_84c3_eb147d95771e 1e6ac800_6dbb_6f4b_aa45_40782e403be1["getMeasureIterations()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| 1e6ac800_6dbb_6f4b_aa45_40782e403be1 349416b0_ec36_b925_56fd_86a53710f562["String()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| 349416b0_ec36_b925_56fd_86a53710f562 0b030684_6eb8_579d_a63c_c345d7b4051e["handleUnexpectedException()"] 9778b63c_6178_7689_7f4b_f7e25a1383ca -->|method| 0b030684_6eb8_579d_a63c_c345d7b4051e
Relationship Graph
Source Code
microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java lines 41–118
@Warmup(iterations = AbstractMicrobenchmarkBase.DEFAULT_WARMUP_ITERATIONS, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = AbstractMicrobenchmarkBase.DEFAULT_MEASURE_ITERATIONS, time = 1, timeUnit = TimeUnit.SECONDS)
@State(Scope.Thread)
public abstract class AbstractMicrobenchmarkBase {
protected static final int DEFAULT_WARMUP_ITERATIONS = 10;
protected static final int DEFAULT_MEASURE_ITERATIONS = 10;
protected static final String[] BASE_JVM_ARGS = {
"-server", "-dsa", "-da", "-ea:io.netty...",
"-XX:+HeapDumpOnOutOfMemoryError", "-Dio.netty.leakDetection.level=disabled"};
static {
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.DISABLED);
}
protected ChainedOptionsBuilder newOptionsBuilder() throws Exception {
String className = getClass().getSimpleName();
ChainedOptionsBuilder runnerOptions = new OptionsBuilder()
.include(".*\\." + className + "\\..*")
.jvmArgs(jvmArgs());
if (getWarmupIterations() > 0) {
runnerOptions.warmupIterations(getWarmupIterations());
}
if (getMeasureIterations() > 0) {
runnerOptions.measurementIterations(getMeasureIterations());
}
if (getReportDir() != null) {
String filePath = getReportDir() + className + ".json";
File file = new File(filePath);
if (file.exists()) {
file.delete();
} else {
file.getParentFile().mkdirs();
file.createNewFile();
}
runnerOptions.resultFormat(ResultFormatType.JSON);
runnerOptions.result(filePath);
}
return runnerOptions;
}
protected abstract String[] jvmArgs();
static void removeAssertions(List<String> jvmArgs) {
for (Iterator<String> iterator = jvmArgs.iterator(); iterator.hasNext();) {
String jvmArg = iterator.next();
if (jvmArg.startsWith("-ea")) {
iterator.remove();
}
}
}
@Test
public void run() throws Exception {
new Runner(newOptionsBuilder().build()).run();
}
protected int getWarmupIterations() {
return SystemPropertyUtil.getInt("warmupIterations", -1);
}
protected int getMeasureIterations() {
return SystemPropertyUtil.getInt("measureIterations", -1);
}
protected String getReportDir() {
return SystemPropertyUtil.get("perfReportDir");
}
public static void handleUnexpectedException(Throwable t) {
assertNull(t);
}
}
Source
Frequently Asked Questions
What is the AbstractMicrobenchmarkBase class?
AbstractMicrobenchmarkBase is a class in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java.
Where is AbstractMicrobenchmarkBase defined?
AbstractMicrobenchmarkBase is defined in microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmarkBase.java at line 41.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free