Home / Class/ AbstractMicrobenchmark Class — netty Architecture

AbstractMicrobenchmark Class — netty Architecture

Architecture documentation for the AbstractMicrobenchmark class in AbstractMicrobenchmark.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2cfff388_78dc_d269_7177_75ac1e256936["AbstractMicrobenchmark"]
  74f9349e_1d3e_38ae_2f43_89a331a2c074["AbstractMicrobenchmark.java"]
  2cfff388_78dc_d269_7177_75ac1e256936 -->|defined in| 74f9349e_1d3e_38ae_2f43_89a331a2c074
  6090803d_f20c_f3fd_971b_04308bde7015["AbstractMicrobenchmark()"]
  2cfff388_78dc_d269_7177_75ac1e256936 -->|method| 6090803d_f20c_f3fd_971b_04308bde7015
  0b17de7c_5134_31be_c192_6b6f21e64672["jvmArgs()"]
  2cfff388_78dc_d269_7177_75ac1e256936 -->|method| 0b17de7c_5134_31be_c192_6b6f21e64672
  dcb2b919_bdd0_ef4f_6fe0_d3cd91e64566["ChainedOptionsBuilder()"]
  2cfff388_78dc_d269_7177_75ac1e256936 -->|method| dcb2b919_bdd0_ef4f_6fe0_d3cd91e64566
  1b283712_0a5d_257f_6217_82658a5d9c5d["getForks()"]
  2cfff388_78dc_d269_7177_75ac1e256936 -->|method| 1b283712_0a5d_257f_6217_82658a5d9c5d

Relationship Graph

Source Code

microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java lines 43–173

@Fork(AbstractMicrobenchmark.DEFAULT_FORKS)
public class AbstractMicrobenchmark extends AbstractMicrobenchmarkBase {

    protected static final int DEFAULT_FORKS = 2;

    public static final class HarnessExecutor extends ThreadPoolExecutor {
        private static final InternalLogger logger = InternalLoggerFactory.getInstance(AbstractMicrobenchmark.class);

        public HarnessExecutor(int maxThreads, String prefix) {
            super(maxThreads, maxThreads, 0, TimeUnit.MILLISECONDS,
                    new LinkedBlockingQueue<Runnable>(),
                    new DefaultThreadFactory(prefix));
            EventExecutor eventExecutor = new AbstractEventExecutor() {
                @Override
                public void shutdown() {
                    throw new UnsupportedOperationException();
                }

                @Override
                public boolean inEventLoop(Thread thread) {
                    return thread instanceof FastThreadLocalThread;
                }

                @Override
                public boolean isShuttingDown() {
                    throw new UnsupportedOperationException();
                }

                @Override
                public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) {
                    throw new UnsupportedOperationException();
                }

                @Override
                public Future<?> terminationFuture() {
                    throw new UnsupportedOperationException();
                }

                @Override
                public boolean isShutdown() {
                    throw new UnsupportedOperationException();
                }

                @Override
                public boolean isTerminated() {
                    throw new UnsupportedOperationException();
                }

                @Override
                public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
                    throw new UnsupportedOperationException();
                }

                @Override
                public void execute(Runnable command) {
                    throw new UnsupportedOperationException();
                }
            };
            setThreadFactory(ThreadExecutorMap.apply(getThreadFactory(), eventExecutor));

            logger.debug("Using harness executor");
        }
    }

    private final String[] jvmArgs;

    /**
     * Default settings:
     * <br>
     * Disable assertion in package: {@code io.netty.*}, except {@code io.netty.microbench.*}.
     * <br>
     * Use custom {@code HarnessExecutor}.
     */
    public AbstractMicrobenchmark() {
        this(true, false);
    }

    /**
     * @param disableAssertions If true, it will disable assertion in package: {@code io.netty.*},
     *                          except {@code io.netty.microbench.*},
     *                          which means package {@code io.netty.microbench.*} always gets assertion enabled.

Frequently Asked Questions

What is the AbstractMicrobenchmark class?
AbstractMicrobenchmark is a class in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java.
Where is AbstractMicrobenchmark defined?
AbstractMicrobenchmark is defined in microbench/src/main/java/io/netty/microbench/util/AbstractMicrobenchmark.java at line 43.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free