-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add db_runtime and view_runtime to middleware #58
Comments
+1 for I always forget if rails' concept of that includes AR object instantiation or not. I've looked that up like 10 times over the years. If not, we should provide guidance that the db impact looks (in some cases much) smaller than the reality is. I guess we should also include some default absolute and relative thresholds in these cases. I'm not a huge fan of Up to you if you want to encode them all in a header. Not against it. |
I'm pretty sure it's just time spend executing in the database driver (so it includes the roundtrip to the server). I'm not sure where and if we need to add this information and how we should process it. I wanted to start by exposing it and probably gathering it. |
Sounds right to me. I prob have a rails project somewhere that confirms that instantiation is excluded. Instantiation of large numbers of records is a regular confusion for people that sometimes leads them to dismiss db as the root cause: "My query executed in 'only' 30 seconds, where is this other 2 minutes of time coming from?" |
In Rails 5 we can get
db_runtime
andview_runtime
for a controller action through Active Support notifications. It might be interesting to add these to the response headers.At which point does it make sense to encode multiple values in one header? For example:
The text was updated successfully, but these errors were encountered: