vlsi opened a new issue, #5955:
URL: https://github.com/apache/jmeter/issues/5955

   ### Use case
   
   Fine-tuning HTTP samplers requires runing a server that could respond fast 
with minimal resource utilization.
   
   What do you think if we integrate a small mock server into JMeter sources?
   I guess it would simplify to test performance-related changes.
   
   ### Possible solution
   
   I tried the following, and I got ~88K/sec for HTTPClient4 implementation and 
~60K/sec for Java implementation (~8 threads, Java 17, M1 Max)
   
   ```kotlin
   import io.undertow.Undertow
   import io.undertow.util.Headers
   
   fun main() {
       val server = Undertow.builder()
           .addHttpListener(3000, "0.0.0.0")
           .setHandler { exchange ->
               // Sets the return Content-Type to text/html
               exchange.responseHeaders
                   .put(Headers.CONTENT_TYPE, "application/json")
   
               // Returns a hard-coded HTML document
               exchange.responseSender
                   .send("""{"result":"ok"}""")
           }.build()
   
       // Boot the web server
       server.start()
   }
   ```
   
   I guess we could predefined several routes (e.g. chunked encoding, large 
response, small response, etc).
   
   The drawback would be to version churn (Renovate bot would ask us upgrading 
the versions as they release)
   
   WDYT?
   
   ### Possible workarounds
   
   _No response_
   
   ### JMeter Version
   
   5.5
   
   ### Java Version
   
   _No response_
   
   ### OS Version
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jmeter.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to