Class: RubyProf::CallInfo
- Inherits:
-
Object
- Object
- RubyProf::CallInfo
- Defined in:
- ext/ruby_prof.c,
ext/ruby_prof.c
Overview
RubyProf::CallInfo is a helper class used by RubyProf::MethodInfo to keep track of which child methods were called and how long they took to execute.
Instance Method Summary collapse
-
#called ⇒ Integer
Returns the total amount of time this method was called.
-
#children_time ⇒ Float
Returns the total amount of time spent in this method’s children.
-
#line_no ⇒ Integer
returns the line number of the method.
-
#self_time ⇒ Float
Returns the total amount of time spent in this method.
-
#called ⇒ MethodInfo
Returns the target method.
-
#total_time ⇒ Float
Returns the total amount of time spent in this method and its children.
-
#wait_time ⇒ Float
Returns the total amount of time this method waited for other threads.
Instance Method Details
#called ⇒ Integer
Returns the total amount of time this method was called.
499 500 501 502 503 504 505 |
# File 'ext/ruby_prof.c', line 499
static VALUE
call_info_called(VALUE self)
{
prof_call_info_t *result = get_call_info_result(self);
return INT2NUM(result->called);
}
|
#children_time ⇒ Float
Returns the total amount of time spent in this method’s children.
557 558 559 560 561 562 563 |
# File 'ext/ruby_prof.c', line 557
static VALUE
call_info_children_time(VALUE self)
{
prof_call_info_t *result = get_call_info_result(self);
prof_measure_t children_time = result->total_time - result->self_time - result->wait_time;
return rb_float_new(convert_measurement(children_time));
}
|
#line_no ⇒ Integer
returns the line number of the method
511 512 513 514 515 |
# File 'ext/ruby_prof.c', line 511
static VALUE
call_info_line(VALUE self)
{
return rb_int_new(get_call_info_result(self)->line);
}
|
#self_time ⇒ Float
Returns the total amount of time spent in this method.
533 534 535 536 537 538 539 |
# File 'ext/ruby_prof.c', line 533
static VALUE
call_info_self_time(VALUE self)
{
prof_call_info_t *result = get_call_info_result(self);
return rb_float_new(convert_measurement(result->self_time));
}
|
#called ⇒ MethodInfo
Returns the target method.
484 485 486 487 488 489 490 491 492 493 |
# File 'ext/ruby_prof.c', line 484
static VALUE
call_info_target(VALUE self)
{
/* Target is a pointer to a method_info - so we have to be careful
about the GC. We will wrap the method_info but provide no
free method so the underlying object is not freed twice! */
prof_call_info_t *result = get_call_info_result(self);
return Data_Wrap_Struct(cMethodInfo, NULL, NULL, result->target);
}
|
#total_time ⇒ Float
Returns the total amount of time spent in this method and its children.
521 522 523 524 525 526 527 |
# File 'ext/ruby_prof.c', line 521
static VALUE
call_info_total_time(VALUE self)
{
prof_call_info_t *result = get_call_info_result(self);
return rb_float_new(convert_measurement(result->total_time));
}
|
#wait_time ⇒ Float
Returns the total amount of time this method waited for other threads.
545 546 547 548 549 550 551 |
# File 'ext/ruby_prof.c', line 545
static VALUE
call_info_wait_time(VALUE self)
{
prof_call_info_t *result = get_call_info_result(self);
return rb_float_new(convert_measurement(result->wait_time));
}
|