jhawthorn / vernier

📏 next generation CRuby profiler
https://vernier.prof/
MIT License
806 stars 17 forks source link

Refactor marker handling #10

Closed tenderlove closed 1 year ago

tenderlove commented 1 year ago

This PR refactors the way we handle markers. My main goal was to make the profiler instance responsible for reconciling GC markers. Now we can add an "add marker" interface to the collector so that users can add custom markers to their profiles.

One change of note is that I moved the stop method to Ruby, and change the C++ implementation to a private method called finish.

I also exposed the marker type enum in Ruby and pulled the marker name string literals in to Ruby as well.

I added an initialize method to the collector object so we can initialize a Ruby array for custom markers (right now it just keeps the profile type as an ivar).