Class: Selenium::DevTools::V85::Profiler
- Inherits:
-
Object
- Object
- Selenium::DevTools::V85::Profiler
- Defined in:
- lib/selenium/devtools/v85/profiler.rb
Constant Summary collapse
- EVENTS =
{ console_profile_finished: 'consoleProfileFinished', console_profile_started: 'consoleProfileStarted', precise_coverage_delta_update: 'preciseCoverageDeltaUpdate', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #disable_runtime_call_stats ⇒ Object
- #enable ⇒ Object
- #enable_runtime_call_stats ⇒ Object
- #get_best_effort_coverage ⇒ Object
- #get_runtime_call_stats ⇒ Object
-
#initialize(devtools) ⇒ Profiler
constructor
A new instance of Profiler.
- #on(event, &block) ⇒ Object
- #set_sampling_interval(interval:) ⇒ Object
- #start ⇒ Object
- #start_precise_coverage(call_count: nil, detailed: nil, allow_triggered_updates: nil) ⇒ Object
- #start_type_profile ⇒ Object
- #stop ⇒ Object
- #stop_precise_coverage ⇒ Object
- #stop_type_profile ⇒ Object
- #take_precise_coverage ⇒ Object
- #take_type_profile ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Profiler
Returns a new instance of Profiler.
31 32 33 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 31 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
40 41 42 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 40 def disable @devtools.send_cmd('Profiler.disable') end |
#disable_runtime_call_stats ⇒ Object
96 97 98 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 96 def disable_runtime_call_stats @devtools.send_cmd('Profiler.disableRuntimeCallStats') end |
#enable ⇒ Object
44 45 46 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 44 def enable @devtools.send_cmd('Profiler.enable') end |
#enable_runtime_call_stats ⇒ Object
92 93 94 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 92 def enable_runtime_call_stats @devtools.send_cmd('Profiler.enableRuntimeCallStats') end |
#get_best_effort_coverage ⇒ Object
48 49 50 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 48 def get_best_effort_coverage @devtools.send_cmd('Profiler.getBestEffortCoverage') end |
#get_runtime_call_stats ⇒ Object
100 101 102 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 100 def get_runtime_call_stats @devtools.send_cmd('Profiler.getRuntimeCallStats') end |
#on(event, &block) ⇒ Object
35 36 37 38 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 35 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Profiler.#{event}"] << block end |
#set_sampling_interval(interval:) ⇒ Object
52 53 54 55 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 52 def set_sampling_interval(interval:) @devtools.send_cmd('Profiler.setSamplingInterval', interval: interval) end |
#start ⇒ Object
57 58 59 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 57 def start @devtools.send_cmd('Profiler.start') end |
#start_precise_coverage(call_count: nil, detailed: nil, allow_triggered_updates: nil) ⇒ Object
61 62 63 64 65 66 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 61 def start_precise_coverage(call_count: nil, detailed: nil, allow_triggered_updates: nil) @devtools.send_cmd('Profiler.startPreciseCoverage', callCount: call_count, detailed: detailed, allowTriggeredUpdates: allow_triggered_updates) end |
#start_type_profile ⇒ Object
68 69 70 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 68 def start_type_profile @devtools.send_cmd('Profiler.startTypeProfile') end |
#stop ⇒ Object
72 73 74 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 72 def stop @devtools.send_cmd('Profiler.stop') end |
#stop_precise_coverage ⇒ Object
76 77 78 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 76 def stop_precise_coverage @devtools.send_cmd('Profiler.stopPreciseCoverage') end |
#stop_type_profile ⇒ Object
80 81 82 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 80 def stop_type_profile @devtools.send_cmd('Profiler.stopTypeProfile') end |
#take_precise_coverage ⇒ Object
84 85 86 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 84 def take_precise_coverage @devtools.send_cmd('Profiler.takePreciseCoverage') end |
#take_type_profile ⇒ Object
88 89 90 |
# File 'lib/selenium/devtools/v85/profiler.rb', line 88 def take_type_profile @devtools.send_cmd('Profiler.takeTypeProfile') end |