mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add a way to print debug counters without exiting
I am trying to study debug counters inside a Rails application. Accessing debug counters by killing the process is hard because child processes don't get the same TRAP as the parent, and Rails seems to intercept calls to `exit`. Adding this method lets me print the debug counters when I want (at the end of requests for example)
This commit is contained in:
parent
2f3795113d
commit
70fd099220
3 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,13 @@ rb_debug_counter_show_results(const char *msg)
|
|||
}
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_debug_counter_show(void)
|
||||
{
|
||||
rb_debug_counter_show_results("method call");
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_debug_counter_reset(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue