Search code examples
httpstreamingperformance-testingtaurus

Does Taurus supports http streaming responses?


I have an endpoint which calls ChatGPT streaming search API. My endpoint returns the streaming data from ChatGPT API. I want to write a performance test for my endpoint. I am wondering whether Taurus will work properly with streaming response? I am using Jemeter Executor.

I tried to google but could not find much information about this topic. Would appriciate it if soneone could help.


Solution

  • As per OpenAI API Reference

    Streaming

    The OpenAI API provides the ability to stream responses back to a client in order to allow partial results for certain requests. To achieve this, we follow the Server-sent events standard. Our official Node and Python libraries include helpers to make parsing these events simpler.

    Out of the box JMeter doesn't support Server-sent events so you will have to use a library like okhttp-eventsource from JSR223 Sampler

    See How to Load Test SSE Services with JMeter article for more information and reference code

    In order to tell Taurus to use existing JMeter with the library which supports Server-sent events you either need to have JMeter installed in your operating system PATH or provide its location via modules.jmeter.path property:

    If there is no JMeter installed at the configured path, Taurus will attempt to install the latest JMeter and Plugins into this location, by default ~/.bzt/jmeter-taurus/{version}/bin/jmeter. You can change this setting to your preferred JMeter location (consider putting it into ~/.bzt-rc file), see JMeter Location & Auto-Installation Taurus documentation chapter for more details.