distributed-system-analysis / pbench

A benchmarking and performance analysis framework
http://distributed-system-analysis.github.io/pbench/
GNU General Public License v3.0
188 stars 108 forks source link

Return "raw" API parameters in pagination #3412

Closed dbutenhof closed 1 year ago

dbutenhof commented 1 year ago

PBENCH-1133

The GET /datasets response is optimized for sequential pagination, providing a convenient "next_url" string that can be used directly. However if a client wants to support "random access" pagination, this requires that the client parses the URL string in order to modify the offset parameter.

This attempts to make that a bit easier by supplementing the current response payload with a parameters field containing the query parameters JSON object, making it easy to update the offset parameter.

(Making the unit tests work against the normalized parameter list proved a bit challenging and I ended up saving the original "raw" client parameters in the API context so they can be used directly.)