jhawthorn / vernier

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

Store options given to collector in the result #30

Closed dalehamel closed 2 weeks ago

dalehamel commented 8 months ago

Eg:

https://github.com/jhawthorn/vernier/blob/dc16edfa9dba0f077b9da4777761312273ad10af/ext/vernier/vernier.cc#L1482-L1503

Can the mode and interval passed to the collector be added to Result (perhaps in Result.meta hash?) so that we can determine after the fact what the parameters were for the profile?

So something like:

collector = Vernier::Collector.new(:wall, interval: 1000)
collector.start
foo
result = collector.stop
assert_equal :wall, result.meta[:mode] 
assert_equal 1000, result.meta[:interval]
joshuay03 commented 3 weeks ago

https://github.com/jhawthorn/vernier/pull/76