Class: Selenium::DevTools::V131::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v131/memory.rb

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Memory

Returns a new instance of Memory.



26
27
28
# File 'lib/selenium/devtools/v131/memory.rb', line 26

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#forcibly_purge_javascript_memoryObject



47
48
49
# File 'lib/selenium/devtools/v131/memory.rb', line 47

def forcibly_purge_javascript_memory
  @devtools.send_cmd('Memory.forciblyPurgeJavaScriptMemory')
end

#get_all_time_sampling_profileObject



71
72
73
# File 'lib/selenium/devtools/v131/memory.rb', line 71

def get_all_time_sampling_profile
  @devtools.send_cmd('Memory.getAllTimeSamplingProfile')
end

#get_browser_sampling_profileObject



75
76
77
# File 'lib/selenium/devtools/v131/memory.rb', line 75

def get_browser_sampling_profile
  @devtools.send_cmd('Memory.getBrowserSamplingProfile')
end

#get_dom_countersObject



35
36
37
# File 'lib/selenium/devtools/v131/memory.rb', line 35

def get_dom_counters
  @devtools.send_cmd('Memory.getDOMCounters')
end

#get_dom_counters_for_leak_detectionObject



39
40
41
# File 'lib/selenium/devtools/v131/memory.rb', line 39

def get_dom_counters_for_leak_detection
  @devtools.send_cmd('Memory.getDOMCountersForLeakDetection')
end

#get_sampling_profileObject



79
80
81
# File 'lib/selenium/devtools/v131/memory.rb', line 79

def get_sampling_profile
  @devtools.send_cmd('Memory.getSamplingProfile')
end

#on(event, &block) ⇒ Object



30
31
32
33
# File 'lib/selenium/devtools/v131/memory.rb', line 30

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["Memory.#{event}"] << block
end

#prepare_for_leak_detectionObject



43
44
45
# File 'lib/selenium/devtools/v131/memory.rb', line 43

def prepare_for_leak_detection
  @devtools.send_cmd('Memory.prepareForLeakDetection')
end

#set_pressure_notifications_suppressed(suppressed:) ⇒ Object



51
52
53
54
# File 'lib/selenium/devtools/v131/memory.rb', line 51

def set_pressure_notifications_suppressed(suppressed:)
  @devtools.send_cmd('Memory.setPressureNotificationsSuppressed',
                     suppressed: suppressed)
end

#simulate_pressure_notification(level:) ⇒ Object



56
57
58
59
# File 'lib/selenium/devtools/v131/memory.rb', line 56

def simulate_pressure_notification(level:)
  @devtools.send_cmd('Memory.simulatePressureNotification',
                     level: level)
end

#start_sampling(sampling_interval: nil, suppress_randomness: nil) ⇒ Object



61
62
63
64
65
# File 'lib/selenium/devtools/v131/memory.rb', line 61

def start_sampling(sampling_interval: nil, suppress_randomness: nil)
  @devtools.send_cmd('Memory.startSampling',
                     samplingInterval: sampling_interval,
                     suppressRandomness: suppress_randomness)
end

#stop_samplingObject



67
68
69
# File 'lib/selenium/devtools/v131/memory.rb', line 67

def stop_sampling
  @devtools.send_cmd('Memory.stopSampling')
end