Forum: Ruby-core [Feature #2480] request to add GC::Profiler.time method

Posted by Roger Pack (Guest)
on 2009-12-14 19:07
(Received via mailing list)
Feature #2480: request to add GC::Profiler.time method
http://redmine.ruby-lang.org/issues/show/2480

Author: Roger Pack
Status: Open, Priority: Normal

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
Posted by Yusuke Endoh (Guest)
on 2010-02-28 12:55
(Received via mailing list)
Issue #2480 has been updated by Yusuke Endoh.

Category deleted (core)
Status changed from Assigned to Open
Assigned to deleted (Narihiro Nakamura)
Target version deleted (1.9.x)

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>
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2480
Posted by _ wanabe (Guest)
on 2010-03-03 15:19
(Received via mailing list)
Issue #2480 has been updated by _ wanabe.

File gc_prof_totaltime.patch added

I wrote a patch.
If it is OK, I'll commit later.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2480
Posted by Yusuke ENDOH (Guest)
on 2010-03-03 17:16
(Received via mailing list)
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.
Posted by Narihiro Nakamura (Guest)
on 2010-03-04 00:46
(Received via mailing list)
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.
Posted by _ wanabe (Guest)
on 2010-03-04 06:20
(Received via mailing list)
Issue #2480 has been updated by _ wanabe.

Status changed from Assigned to Closed

Applied at r26814. Thank you.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2480
Posted by Roger Pack (Guest)
on 2010-03-04 20:16
(Received via mailing list)
Issue #2480 has been updated by Roger Pack.


Many thanks.  I will use this in the ruby-prof gem most likely, for more 
intuitive profiling.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2480
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.