Hi all,
In BaseX, is there a way to get the profile timings (compile, run, print, etc.) in the response of a HTTP request via the Server-Timing header ( https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)?
Kind regards, Reece
A good idea; I’ll think of ways to get this included. One challenge might be that the response is streamed to the client. This means that when creating the HTTP request headers, it will not be known yet how long the evaluation will take (and the time for evaluation may also depend on the connection speed). The time for parsing and compiling the query should be known at that time, though. – Maybe we could suppress result streaming when timings are requested.
On Thu, Apr 29, 2021 at 9:50 PM Reece Dunn msclrhd@googlemail.com wrote:
Hi all,
In BaseX, is there a way to get the profile timings (compile, run, print, etc.) in the response of a HTTP request via the Server-Timing header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)?
Kind regards, Reece
Hi Reece,
The responses of RESTXQ requests are now decorated with an additional Server-Timing headers [1].
You may experience that the timing for serialize is zero, or close to zero. The reason is that (as described) the actual result will only be generated while the result is being transmitted to the client. The %rest:single annotation, which allows developers to cancel running server requests, can currently be used to enforce the caching of a result. Otherwise, the time could be achieved by subtracting the returned times from the total request time.
A new snapshot is online [2], I’m looking forward to your feedback. Would you expect other HTTP services (such as our standard REST API) to also return timing results?
Cheers, Christian
[1] https://github.com/BaseXdb/basex/issues/2008 [2] https://files.basex.org/releases/latest/
On Thu, Apr 29, 2021 at 9:50 PM Reece Dunn msclrhd@googlemail.com wrote:
Hi all,
In BaseX, is there a way to get the profile timings (compile, run, print, etc.) in the response of a HTTP request via the Server-Timing header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)?
Kind regards, Reece
basex-talk@mailman.uni-konstanz.de