I was thinking, what if you need a server that serves a page that does alot of processing, it sends multiple commands, does alot of queries and most of them takes a long time. Waiting for all commands to finish isn’t an option, fast response time is also a requirement, so a solution could be warming up a cache then render the page from this cache. That solution means you will also wait for all commands/queries to finish then respond with your output.
I was researching a simple way to trace ruby code, so the problem I tried to solve (as usual) is to understand the code infront of me even more, so I need some monitor, when I open a rails server and I navigate around, I need to see the methods executed and where is it located, I need to see that in realtime. Turns out the solution is very simple, as Ruby has TracePoint module, you can use it to log any thing gets called in your application, so adding this snippet to your rails initializers or anywhere before your application starts.
Comments
Post a Comment