luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.57k stars 156 forks source link

Add more info to the RequestCompleteEvent #1844

Open jwoertink opened 7 months ago

jwoertink commented 7 months ago

The LogHandler publishes a Pulsar event RequestCompleteEvent which lets you know the duration a request took. This is something you'd use in Breeze to store how long each request took. I think it would be great to add in context as well since we already have access to it. Then you could subscribe and send off your own events. Without access to context from the event, you only know how long something took... You don't know what that something was.

https://github.com/luckyframework/lucky/blob/8eef897212ebbcbb6f0735ae3d8c3381f44b2449/src/lucky/log_handler.cr#L38