tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
737 stars 67 forks source link

Issue 526: Fix blank graph bits #581

Closed alecsmrekar closed 3 months ago

alecsmrekar commented 5 months ago

https://github.com/tag1consulting/goose/issues/526

This is a relatively simple change that prevents the chart from rendering 0 values.

The base change is in TimeSeriesValue, where get_graph_value is converted to detect zeros, if it does, it returns a None. Converting the return value from U to Option<U> then allows us to filter out blank values when constructing chart data in add_timestamp_to_html_graph_data.

To test this, just run a few different transactions, and maybe add set_wait_time to make sure you have some seconds where nothing happened. Then open up the HTML report and looks at the pretty chart.

It's worth noting that the person who opened the original issue complained that this solution actually makes graphs looks worse, which might very well be true in some circumstances. A solution might be to adjust the chart JS a bit so that it adds dots to where data points are, so the user is not confused where requests actually happened. Example:

image

Another alternative would be to switch to a scatter plot. Which for me personally is a lot harder to read data from at a quick glance, although is solves the issue of connecting dots that are too distant.

image