Reputation: 71
Is it possible to log the query time (execution) in Yesod or generally in persistent?
I see that in the debug mode, I get in the terminal the query with its parameter. However I cannot see the total time of its execution, therefore I cannot spot slow queries by this method.
Is there some kind of existing tool for visualization of the queries of a request? Instead of printing them in the terminal? Something similar to the "debug bars" of other frameworks?
Upvotes: 2
Views: 126
Reputation: 48756
The ekg related packages are the one usually used to monitor application level statistics in Yesod (or any other Haskell web framework for that matter). This is a good guide for you to start. But for getting statistics related to the query from persistent
, I think criterion would be a better fit but it is an after benchmark tool. The flow would be to initially identifying bottleneck for the individual handlers via ekg and then do criterion benchmarks for the used functions in the handler to find the actual culprit.
Upvotes: 2