Class: Selenium::DevTools::V85::Profiler

Inherits:
Object
  • Object
show all
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

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

#disableObject



40
41
42
# File 'lib/selenium/devtools/v85/profiler.rb', line 40

def disable
  @devtools.send_cmd('Profiler.disable')
end

#disable_runtime_call_statsObject



96
97
98
# File 'lib/selenium/devtools/v85/profiler.rb', line 96

def disable_runtime_call_stats
  @devtools.send_cmd('Profiler.disableRuntimeCallStats')
end

#enableObject



44
45
46
# File 'lib/selenium/devtools/v85/profiler.rb', line 44

def enable
  @devtools.send_cmd('Profiler.enable')
end

#enable_runtime_call_statsObject



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_coverageObject



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_statsObject



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

#startObject



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_profileObject



68
69
70
# File 'lib/selenium/devtools/v85/profiler.rb', line 68

def start_type_profile
  @devtools.send_cmd('Profiler.startTypeProfile')
end

#stopObject



72
73
74
# File 'lib/selenium/devtools/v85/profiler.rb', line 72

def stop
  @devtools.send_cmd('Profiler.stop')
end

#stop_precise_coverageObject



76
77
78
# File 'lib/selenium/devtools/v85/profiler.rb', line 76

def stop_precise_coverage
  @devtools.send_cmd('Profiler.stopPreciseCoverage')
end

#stop_type_profileObject



80
81
82
# File 'lib/selenium/devtools/v85/profiler.rb', line 80

def stop_type_profile
  @devtools.send_cmd('Profiler.stopTypeProfile')
end

#take_precise_coverageObject



84
85
86
# File 'lib/selenium/devtools/v85/profiler.rb', line 84

def take_precise_coverage
  @devtools.send_cmd('Profiler.takePreciseCoverage')
end

#take_type_profileObject



88
89
90
# File 'lib/selenium/devtools/v85/profiler.rb', line 88

def take_type_profile
  @devtools.send_cmd('Profiler.takeTypeProfile')
end