Class: Nanoc::CLI::Commands::Compile::StackProfProfiler Private
- Defined in:
- lib/nanoc/cli/commands/compile.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Records a profile using StackProf
Constant Summary collapse
- PROFILE_FILE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'tmp/stackprof_profile'.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #start ⇒ Object private
- #stop ⇒ Object private
Methods inherited from Listener
#initialize, #start_safely, #stop_safely
Constructor Details
This class inherits a constructor from Nanoc::CLI::Commands::Compile::Listener
Class Method Details
.enable_for?(command_runner) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
375 376 377 |
# File 'lib/nanoc/cli/commands/compile.rb', line 375 def self.enable_for?(command_runner) command_runner..fetch(:profile, false) end |
Instance Method Details
#start ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
380 381 382 383 |
# File 'lib/nanoc/cli/commands/compile.rb', line 380 def start require 'stackprof' StackProf.start(mode: :cpu) end |
#stop ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
386 387 388 389 |
# File 'lib/nanoc/cli/commands/compile.rb', line 386 def stop StackProf.stop StackProf.results(PROFILE_FILE) end |