org.openqa.selenium.devtools.v107.performancetimeline.PerformanceTimeline Maven / Gradle / Ivy
package org.openqa.selenium.devtools.v107.performancetimeline;
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;
/**
* Reporting of performance timeline events, as specified in
* https://w3c.github.io/performance-timeline/#dom-performanceobserver.
*/
@Beta()
public class PerformanceTimeline {
/**
* Previously buffered events would be reported before method returns.
* See also: timelineEventAdded
*/
public static Command enable(java.util.List eventTypes) {
java.util.Objects.requireNonNull(eventTypes, "eventTypes is required");
ImmutableMap.Builder params = ImmutableMap.builder();
params.put("eventTypes", eventTypes);
return new Command<>("PerformanceTimeline.enable", params.build());
}
public static Event timelineEventAdded() {
return new Event<>("PerformanceTimeline.timelineEventAdded", ConverterFunctions.map("event", org.openqa.selenium.devtools.v107.performancetimeline.model.TimelineEvent.class));
}
}