setup() — netty Function Reference
Architecture documentation for the setup() function in IsKeepAliveBenchmark.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 5d4e8a23_ec4d_912b_b2ee_9ef5647c8df5["setup()"] 4326e7e2_fab3_dec2_fce8_32dffea2c089["IsKeepAliveBenchmark"] 5d4e8a23_ec4d_912b_b2ee_9ef5647c8df5 -->|defined in| 4326e7e2_fab3_dec2_fce8_32dffea2c089 be08850d_2c75_2ebc_cbd6_16faa4a19961["setConnectionClose()"] 5d4e8a23_ec4d_912b_b2ee_9ef5647c8df5 -->|calls| be08850d_2c75_2ebc_cbd6_16faa4a19961 6bb029a1_c25a_6063_83d3_4f183003dbac["isKeepAlive()"] 5d4e8a23_ec4d_912b_b2ee_9ef5647c8df5 -->|calls| 6bb029a1_c25a_6063_83d3_4f183003dbac style 5d4e8a23_ec4d_912b_b2ee_9ef5647c8df5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
microbench/src/main/java/io/netty/microbench/headers/IsKeepAliveBenchmark.java lines 66–103
@Setup
public void setup(Blackhole bh) {
request = new DefaultFullHttpRequest(
HttpVersion.HTTP_1_1,
HttpMethod.GET,
"/index.html");
HttpHeaders headers = request.headers();
// values are usually strings decoded out of network buffers
headers.set(HttpHeaderNames.HOST, "localhost");
headers.set(HttpHeaderNames.USER_AGENT,
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
+ "AppleWebKit/537.36 (KHTML, like Gecko) "
+ "Chrome/131.0.0.0 Safari/537.36");
headers.set(HttpHeaderNames.ACCEPT,
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
headers.set(HttpHeaderNames.ACCEPT_LANGUAGE, "en-US,en;q=0.9");
headers.set(HttpHeaderNames.ACCEPT_ENCODING, "gzip, deflate");
headers.set(HttpHeaderNames.UPGRADE_INSECURE_REQUESTS, "1");
headers.set(HttpHeaderNames.CACHE_CONTROL, "max-age=0");
if (warmup) {
// create 3 request variations for warmup based on the ConnectionClose values
ConnectionClose[] cases = ConnectionClose.values();
FullHttpRequest[] requests = new FullHttpRequest[cases.length];
for (int i = 0; i < requests.length; i++) {
requests[i] = request.copy();
setConnectionClose(requests[i].headers(), cases[i]);
}
// warmup with mixed requests
for (int i = 0; i < 100_000; i++) {
for (FullHttpRequest httpRequest : requests) {
bh.consume(isKeepAlive(httpRequest));
}
}
}
// set the actual test case
setConnectionClose(headers, close);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does setup() do?
setup() is a function in the netty codebase, defined in microbench/src/main/java/io/netty/microbench/headers/IsKeepAliveBenchmark.java.
Where is setup() defined?
setup() is defined in microbench/src/main/java/io/netty/microbench/headers/IsKeepAliveBenchmark.java at line 66.
What does setup() call?
setup() calls 2 function(s): isKeepAlive, setConnectionClose.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free