Project

General

Profile

Feature #2480

request to add GC::Profiler.time method

Added by rogerdpack (Roger Pack) over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:27169]

Description

=begin
currently we have
GC::Profiler.enable
# ... stuff
report = GC::Profiler.result # report is set to a verbose ascii string

What I would like is to be able to add garbage time to profiling information [i.e. "within this method, of the total time that was used, GC took 42ms")

GC::Profiler.time
=> float of the total time used (ms).

or could call it time_used or total_time or whatever.

Then it would make adding GC time to profiler time much faster, as I wouldn't have to parse the result output each time to calculate my own total (it would just be a matter of calling Profiler.time, seeing if the time has increased since last setting).

Thanks.
-r
=end

gc_prof_totaltime.patch (1.71 KB) gc_prof_totaltime.patch wanabe (_ wanabe), 03/03/2010 11:17 PM

History

#1 Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to authorNari (Narihiro Nakamura)
  • Target version set to 2.0.0

=begin

=end

#2 Updated by mame (Yusuke Endoh) over 7 years ago

  • Category deleted (core)
  • Status changed from Assigned to Open
  • Assignee deleted (authorNari (Narihiro Nakamura))
  • Target version deleted (2.0.0)

=begin
Hi,

What I would like is to be able to add garbage time to profiling information [i.e. "within this method, of the total time that was used, GC took 42ms")

If anyone (nari?) writes a patch, it can be accepted and committed
because no one has disagreed, I guess.

--
Yusuke Endoh mame@tsg.ne.jp
=end

#3 Updated by mame (Yusuke Endoh) over 7 years ago

  • Category set to core
  • Status changed from Open to Assigned
  • Assignee set to authorNari (Narihiro Nakamura)
  • Target version set to 2.0.0

=begin

=end

#4 Updated by wanabe (_ wanabe) over 7 years ago

=begin
I wrote a patch.
If it is OK, I'll commit later.
=end

#5 Updated by mame (Yusuke Endoh) over 7 years ago

=begin
Hi,

2010/3/3 _ wanabe redmine@ruby-lang.org:

File gc_prof_totaltime.patch added

I wrote a patch.
If it is OK, I'll commit later.

+1

The name `total_time' is also good for me.

--
Yusuke ENDOH mame@tsg.ne.jp

=end

#6 Updated by authorNari (Narihiro Nakamura) over 7 years ago

=begin
Hi,

I wrote a patch.
If it is OK, I'll commit later.

+1

The name `total_time' is also good for me.

Me, too.

--
Narihiro Nakamura (nari)

=end

#7 Updated by wanabe (_ wanabe) over 7 years ago

  • Status changed from Assigned to Closed

=begin
Applied at r26814. Thank you.
=end

#8 Updated by rogerdpack (Roger Pack) over 7 years ago

=begin
Many thanks. I will use this in the ruby-prof gem most likely, for more intuitive profiling.
=end

Also available in: Atom PDF