oha icon indicating copy to clipboard operation
oha copied to clipboard

Provide set of URLs as an input file

Open witsch opened this issue 2 years ago • 1 comments

It'd be very useful to use a set of given URLs for the load test, much like siege's "URL file":

In order to run a regression test or an effective internet simulation, you are going to have to run through the URLs on the server you are testing. To accomplish that, place the URLs in a configuration file.

This makes it possible to collect a realistic set of URL, i.e. from an access log etc, and "replay" them in order to test or ensure performance requirements are still met after some changes.

witsch avatar Jun 29 '23 08:06 witsch

I would suggest extending this idea by providing the ability to set request headers too. Maybe this could be configured by an input YAML file, e.g:

- name: test_one
  path: /test_path
  headers:
    host: test
    user-agent: test_user_agent

- name: test_two
...     

These test cases could be cycled through in order. A possible later development could be to provide a test case weighting percentage.

wjhoward avatar Aug 07 '24 20:08 wjhoward

This has been possible for a while now: https://github.com/hatoo/oha/pull/639

This feature request should be considered complete I think.

svenstaro avatar May 25 '25 19:05 svenstaro

We may adding features that @wjhoward said in the future but I think the original issue is resolved too. Thank you

hatoo avatar May 26 '25 11:05 hatoo

@hatoo I would be happy to investigate an initial implementation for extending #639 to support setting custom request headers as per my comment above. Would you be happy for me to investigate and potentially raise a PR for this?

wjhoward avatar Jul 17 '25 19:07 wjhoward