Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow partial requests of timeline grid #255

Merged
merged 4 commits into from
Dec 19, 2018

Conversation

smarr
Copy link
Contributor

@smarr smarr commented Nov 1, 2018

This PR adds support to request the timeline view in multiple "pages".

It introduces two settings:

  • TIMELINE_GRID_LIMIT is used to decide whether to show the grid or automatically disable it if there are more than the configured benchmarks
  • TIMELINE_GRID_PAGING allows to set the number of benchmarks fetched in one go

I kept the underlying feature of TIMELINE_GRID_LIMIT to be able to disable the automatic fetching for the grid view.

This change also uses StreamingHttpResponse to start sending data as soon as it is ready, while still other database queries my need to be performed. This is likely only useful for large values of TIMELINE_GRID_PAGING.

The user interface should be unchanged.

This should resolve #254.

smarr added 3 commits October 31, 2018 17:38
- add helper method to read setting with default value if not present

Signed-off-by: Stefan Marr <[email protected]>
The page size is configurable as a setting.
Streaming is used to be able to already send data to the client while more database query my still need to be performed.

timeline.js will keep requesting data as long as the nextBenchmarks field indicates an indicates (!== false).
The plotgrid is only reset on the first request.

Signed-off-by: Stefan Marr <[email protected]>
return number_of_revs, benchmarks


def get_stats_with_defaults(res):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice factoring this functions out of the views! They could be moved out of the views module

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, indeed, good point. Where would you want them to be? Not sure it fits into the model?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stats or view_data or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

view_data sounded like a good fit. So, I pushed 503beb5 and moved both helper functions there.

@tobami tobami merged commit 2bf22df into tobami:master Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance of Timeline View with large numbers of Benchmarks
2 participants