1
0
Fork 0
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:
Aaron Patterson 2019-08-06 12:23:30 -07:00
parent 2f3795113d
commit 70fd099220
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6
3 changed files with 9 additions and 0 deletions

View file

@ -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)
{