-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Mark the start of rendering in the log #23710
Comments
|
Working on this |
Like @matthewd's suggestion! That's even better and explains which template kicks things off. Make sure that this log call is set back at the root, not indented 2 chars, btw. |
This can grow up the logs pretty fast-
|
Think @dhh just wanted to mark when rendering began once. So it can be viewed as a separate step in the request, not tiny pebbles of rendering. |
Possibly relevant/related:
|
Current log format of rendering is terrible. We can make it far better because we already have nicely formed example of SQL logging. I have cooler format suggestion that I am using in my project to make a group of start and finish event more obvious. Full screen example: https://monosnap.com/file/VPv1JekywXEpVePm85o8HHHpfmoCHE.png It makes it easier to catch the beginning and end of a rendering:
So the format I propose is:
|
Yeah, I was only looking for start of rendering when the controller first On Tue, Feb 16, 2016 at 5:33 PM, Bogdan Gusiev notifications@github.com
|
How does this look?
Its called once on (render_template with layouts)[https://github.com/vipulnsward/rails/blob/b7758b40fc035a47f6843158155606d455314c42/actionview/lib/action_view/renderer/template_renderer.rb#L52-L52] |
Just need to not indent that Rendering home/index.html.erb line. On Tue, Feb 16, 2016 at 6:26 PM, Vipul A M notifications@github.com wrote:
|
@bogdan I think have two lines for every partial is too busy for my taste, and I don't think having the timing inbetween helps the readability either. |
… that we have started to render something, at the very beginning. This helps to easily identify queries from controller vs views Fixes rails#23710
@dhh why do you think SQL timing is better upfront and partial timing at the end? |
Just reads better to me: "Rendered THIS in THAT amount of time".
|
Ok, so why SQL is different from that? Why it is not |
Because for SQL it's not trying to be a sentence. There's no logging verb. Also, SQL statements are often long, possibly multiline (which could make it unclear re: timing stamp). Rendering doesn't have that problem.
|
That sounds as a pretty weak argument. SQL is trying to be a sentence more than any other language. I think we put timing upfront in SQL because we care more because in most cases this is what causing a slow performance. |
Guess we will just have to agree to disagree on this one.
|
… that we have started to render something, at the very beginning. This helps to easily identify queries from controller vs views Fixes rails#23710
Done |
It would be helpful to know in the log when rendering of the view templates started, so you can quickly glance and see which SQL and other calls are happening in the controller and which are being triggered in the view. I propose:
The text was updated successfully, but these errors were encountered: