Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#526
This is a relatively simple change that prevents the chart from rendering 0 values.
The base change is in
TimeSeriesValue
, whereget_graph_value
is converted to detect zeros, if it does, it returns aNone
. Converting the return value fromU
toOption<U>
then allows us to filter out blank values when constructing chart data inadd_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:
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.