Class: RubyProf::CallInfo

Inherits:
Object
  • Object
show all
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

Instance Method Details

#calledInteger

Returns the total amount of time this method was called.

Returns:

  • (Integer)


533
534
535
536
537
538
539
# File 'ext/ruby_prof.c', line 533

static VALUE
call_info_called(VALUE self)
{
    prof_call_info_t *result = get_call_info_result(self);

    return INT2NUM(result->called);
}

#children_timeFloat

Returns the total amount of time spent in this method’s children.

Returns:

  • (Float)


569
570
571
572
573
574
575
# File 'ext/ruby_prof.c', line 569

static VALUE
call_info_children_time(VALUE self)
{
    prof_call_info_t *result = get_call_info_result(self);
    prof_clock_t children_time = result->total_time - result->self_time;
    return rb_float_new(clock2sec(children_time));
}

#self_timeFloat

Returns the total amount of time spent in this method.

Returns:

  • (Float)


557
558
559
560
561
562
563
# File 'ext/ruby_prof.c', line 557

static VALUE
call_info_self_time(VALUE self)
{
    prof_call_info_t *result = get_call_info_result(self);

    return rb_float_new(clock2sec(result->self_time));
}

#total_timeFloat

Returns the total amount of time spent in this method and its children.

Returns:

  • (Float)


545
546
547
548
549
550
551
# File 'ext/ruby_prof.c', line 545

static VALUE
call_info_total_time(VALUE self)
{
    prof_call_info_t *result = get_call_info_result(self);

    return rb_float_new(clock2sec(result->total_time));
}