Bug #5292

Access to GC::Profiler Records

Added by Charlie Savage over 2 years ago. Updated over 2 years ago.

[ruby-core:39329]
Status:Closed
Priority:Normal
Assignee:-
Category:core
Target version:1.9.3
ruby -v:ruby 1.9.3dev (2011-09-02 revision 33163) [i386-mswin32_100] Backport:

Description

Could the method gcprofilerecord_get be made part of the GC::Profiler class? It returns an array of hashes of various interesting GC measurements.

I'd like ruby-prof to hook into it. Unfortunately, only textual output is currently supported via gcprofileresult. And parsing that output would be a pain.

To do this:

  • 1 line patch to gcc.c:

rbdefinesingletonmethod(rbmProfiler, "records", gcprofilerecord_get, 0);

  • Is is a safe change since the result is a newly created array of hashes each time.

  • Its useful for performance analysis tools (like ruby-prof)

Would be great to have this in 1.9.3 if at all possible.

Thanks - Charlie


Related issues

Duplicates ruby-trunk - Bug #4991: Add a method to retrieve raw data from GC::Profiler Closed 07/08/2011

History

#1 Updated by Charlie Savage over 2 years ago

Sorry - I missed that there was already a request for this two months ago - see #4991. It includes the 1 line patch as well as documentation.

Could it be applied?

#2 Updated by Narihiro Nakamura over 2 years ago

  • Status changed from Open to Closed

This issue was solved with changeset r33224.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • gc.c (InitGC): defined GC::Profiler.rawdata. based on the patch by Eric Hodel. [Bug #4991]

#3 Updated by Charlie Savage over 2 years ago

Thank you.

Can this be part of 1.9.3 or is it too late?

Charlie

#4 Updated by Narihiro Nakamura over 2 years ago

Charlie Savage wrote:

Thank you.

Can this be part of 1.9.3 or is it too late?

Charlie

Sorry, it's too late, because 1.9.3 branch already in feature freeze.

Also available in: Atom PDF