hatoo / oha

Ohayou(おはよう), HTTP load generator, inspired by rakyll/hey with tui animation.
MIT License
5.47k stars 136 forks source link

[Feature Request] Time series CSV / JSON output #542

Open alshdavid opened 2 months ago

alshdavid commented 2 months ago

Hi, thank you for developing this software - it's fantastic.

Would it be possible to add in a time-series/output that counts the number of requests, grouped/counted at a specified unit of time and emits that as CSV?

This could be used to generate a line graph or histogram of requests per second over time.

Something like this:

$ oha --time-series 1s > output.csv
$ cat output.csv

time(s),count
0, 100
1, 120
2, 110
3, 100
4, 90
5, 100

This is helpful in demonstrating the consistency in the delivery of requests. Take for example this run:

https://github.com/user-attachments/assets/01621ddb-f204-4750-ae38-9e0d031f4e45

The "average time" is not helpful in describing the service experience.

hatoo commented 2 months ago

Hi, oha has a similar feature in the rps key on JSON output. You can use it by oha -j. https://github.com/hatoo/oha/blob/6eb9b0e374d5b5a460c5624334a38bd7e1ad9669/schema.json#L212-L282 Do you think this feature is enough for your use cases or not?

alshdavid commented 2 months ago

Not quite, I have a case where my stddev & percentiles scores don't capture the experience depicted by these sorts of runs:

https://github.com/user-attachments/assets/244ab142-cf34-42e9-ac91-4cd6717e4f52

I could be wrong but I feel that creating a line graph that represents the events against their time would be easier to understand

hatoo commented 2 months ago

I've decided to dump all data to sqlite3 rather than export specific analyses. Could you take a look #263 ?