Choose profiling mode based on URL parameter
Closed this issue · 2 comments
I'd like the ability to choose profiling mode by providing a parameter to the __start__
URL or to a one-off run using profile=true
. This would override what is set where I add the middleware to my chain. What are your thoughts on this feature?
Actually, it seems the middleware already accepts these options? Hm...
Thanks for the idea - I'd like this as well. Unfortunately, because of an implementation detail in perftools.rb*, the profiling mode has to be set very early and cannot be changed later on. As a result, I made it an option when configuring the middleware, but not something that could be changed by a URL parameter. Sorry!
*The issue is that the profiling mode is controlled by environment variables that are read by perftools.rb. They are read when perftools.rb is loaded and are not read again. In fact, this might actually be a restriction of the underlying perftools C library, but I don't know for sure. If Aman Gupta changes perftools.rb to support changing the mode after perftools.rb has been loaded, I'll happily update the rack middleware.