Paris.rb 2018 special.
Features
- Add
EventProf.monitor
to instrument arbitrary methods 📝 Docs
Add custom instrumetation easily:
class Work
def do
# ...
end
end
# Instrument Work#do calls with "my.work" event
TestProf::EventProf.monitor(Work, "my.work", :do)
- Adapterize
before_all
📝 Docs
Now it's possible to write your own adapter for before_all
to manage
transactions.
- Add
before_all
for Minitest 📝 Docs
Fixes & Improvements
- Show top
let
declarations per example group in RSpecDissect profiler.
The output now includes the following information:
Top 5 slowest suites (by `let` time):
FunnelsController (./spec/controllers/funnels_controller_spec.rb:3) – 00:38.532 of 00:43.649 (133)
↳ user – 3
↳ funnel – 2
ApplicantsController (./spec/controllers/applicants_controller_spec.rb:3) – 00:33.252 of 00:41.407 (222)
↳ user – 10
↳ funnel – 5
Enabled by default. Disable it with:
TestProf::RSpecDissect.configure do |config|
config.let_stats_enabled = false
end
- Added ability to preserve traits in
FactoryDefault
. 📝 Docs
Disabled by default for compatibility.
Enable globally by FactoryDefault.preserve_traits = true
or for a single create_default
: create_default(:user, preserve_traits: true)
When enabled the default object is only used when there's no traits in the association.
-
Add ability to run only
let
orbefore
profiler with RSpecDissect. -
Collect raw data with StackProf by default.
-
Refactor
:with_clean_fixture
to clean data once per group. -
Fix
RSpec/Aggregate
failures with non-regular examples.
Do not take into account xit
, pending
, its
, etc. examples,
only consider regular it
, specify
, scenario
, example
.