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.
509 510 511 512 513 514 515 |
# File 'ext/ruby_prof.c', line 509
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.
567 568 569 570 571 572 573 |
# File 'ext/ruby_prof.c', line 567
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
521 522 523 524 525 |
# File 'ext/ruby_prof.c', line 521
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.
543 544 545 546 547 548 549 |
# File 'ext/ruby_prof.c', line 543
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.
494 495 496 497 498 499 500 501 502 503 |
# File 'ext/ruby_prof.c', line 494
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.
531 532 533 534 535 536 537 |
# File 'ext/ruby_prof.c', line 531
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.
555 556 557 558 559 560 561 |
# File 'ext/ruby_prof.c', line 555
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));
}
|