All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.openqa.selenium.devtools.v88.memory.Memory Maven / Gradle / Ivy
package org.openqa.selenium.devtools.v88.memory;
import org.openqa.selenium.Beta;
import org.openqa.selenium.devtools.Command;
import org.openqa.selenium.devtools.Event;
import org.openqa.selenium.devtools.ConverterFunctions;
import com.google.common.collect.ImmutableMap;
import org.openqa.selenium.json.JsonInput;
@Beta()
public class Memory {
public static class GetDOMCountersResponse {
private final java.lang.Integer documents;
private final java.lang.Integer nodes;
private final java.lang.Integer jsEventListeners;
public GetDOMCountersResponse(java.lang.Integer documents, java.lang.Integer nodes, java.lang.Integer jsEventListeners) {
this.documents = java.util.Objects.requireNonNull(documents, "documents is required");
this.nodes = java.util.Objects.requireNonNull(nodes, "nodes is required");
this.jsEventListeners = java.util.Objects.requireNonNull(jsEventListeners, "jsEventListeners is required");
}
public java.lang.Integer getDocuments() {
return documents;
}
public java.lang.Integer getNodes() {
return nodes;
}
public java.lang.Integer getJsEventListeners() {
return jsEventListeners;
}
private static GetDOMCountersResponse fromJson(JsonInput input) {
java.lang.Integer documents = 0;
java.lang.Integer nodes = 0;
java.lang.Integer jsEventListeners = 0;
input.beginObject();
while (input.hasNext()) {
switch(input.nextName()) {
case "documents":
documents = input.nextNumber().intValue();
break;
case "nodes":
nodes = input.nextNumber().intValue();
break;
case "jsEventListeners":
jsEventListeners = input.nextNumber().intValue();
break;
default:
input.skipValue();
break;
}
}
input.endObject();
return new GetDOMCountersResponse(documents, nodes, jsEventListeners);
}
}
public static Command getDOMCounters() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.getDOMCounters", params.build(), input -> input.read(org.openqa.selenium.devtools.v88.memory.Memory.GetDOMCountersResponse.class));
}
public static Command prepareForLeakDetection() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.prepareForLeakDetection", params.build());
}
/**
* Simulate OomIntervention by purging V8 memory.
*/
public static Command forciblyPurgeJavaScriptMemory() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.forciblyPurgeJavaScriptMemory", params.build());
}
/**
* Enable/disable suppressing memory pressure notifications in all processes.
*/
public static Command setPressureNotificationsSuppressed(java.lang.Boolean suppressed) {
java.util.Objects.requireNonNull(suppressed, "suppressed is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("suppressed", suppressed);
return new Command<>("Memory.setPressureNotificationsSuppressed", params.build());
}
/**
* Simulate a memory pressure notification in all processes.
*/
public static Command simulatePressureNotification(org.openqa.selenium.devtools.v88.memory.model.PressureLevel level) {
java.util.Objects.requireNonNull(level, "level is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("level", level);
return new Command<>("Memory.simulatePressureNotification", params.build());
}
/**
* Start collecting native memory profile.
*/
public static Command startSampling(java.util.Optional samplingInterval, java.util.Optional suppressRandomness) {
ImmutableMap.Builder params = ImmutableMap.builder();
samplingInterval.ifPresent(p -> params.put("samplingInterval", p));
suppressRandomness.ifPresent(p -> params.put("suppressRandomness", p));
return new Command<>("Memory.startSampling", params.build());
}
/**
* Stop collecting native memory profile.
*/
public static Command stopSampling() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.stopSampling", params.build());
}
/**
* Retrieve native memory allocations profile
* collected since renderer process startup.
*/
public static Command getAllTimeSamplingProfile() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.getAllTimeSamplingProfile", params.build(), ConverterFunctions.map("profile", org.openqa.selenium.devtools.v88.memory.model.SamplingProfile.class));
}
/**
* Retrieve native memory allocations profile
* collected since browser process startup.
*/
public static Command getBrowserSamplingProfile() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.getBrowserSamplingProfile", params.build(), ConverterFunctions.map("profile", org.openqa.selenium.devtools.v88.memory.model.SamplingProfile.class));
}
/**
* Retrieve native memory allocations profile collected since last
* `startSampling` call.
*/
public static Command getSamplingProfile() {
ImmutableMap.Builder params = ImmutableMap.builder();
return new Command<>("Memory.getSamplingProfile", params.build(), ConverterFunctions.map("profile", org.openqa.selenium.devtools.v88.memory.model.SamplingProfile.class));
}
}