Class DefaultPerformanceTiming
- All Implemented Interfaces:
PerformanceTiming
PerformanceTiming
.
Via this implementation you can retrieve the W3C Performance Timing event values from the
browser relative to
the value of the navigationStart
attribute value, thus it won't return epoch values
as querying the
corresponding Javascript attribute directly would, but rather handles
navigationStart
as zero and returns
time values passed since that point in time.
This implementation executes the query (window.performance.timing.
) with a simple
JavascriptExecutor
in a synchronous way.
If a query for a certain metric returns 0 it means it happened at the same moment (at least in
epoch)
than navigationStart
.
A query for a certain metrics returns a negative value if the event has not been registered on the page, or it is not feasible/valid for the given page/page load/redirect.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
getEventValue
(PerformanceTimingEvent event) Returns the value for the argument event type.Return all timing metrics, in particular thewindow.performance.timing
object wrapped in aPerformanceTimingMetrics
object.Returns the value that corresponds to thesecureConnectionStart
event.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluentlenium.core.performance.PerformanceTiming
connectEnd, connectEnd, connectStart, connectStart, domainLookupEnd, domainLookupEnd, domainLookupStart, domainLookupStart, domComplete, domComplete, domContentLoadedEventEnd, domContentLoadedEventEnd, domContentLoadedEventStart, domContentLoadedEventStart, domInteractive, domInteractive, domLoading, domLoading, fetchStart, fetchStart, getEventValue, loadEventEnd, loadEventEnd, loadEventStart, loadEventStart, navigationStart, navigationStart, redirectEnd, redirectEnd, redirectStart, redirectStart, requestStart, requestStart, responseEnd, responseEnd, responseStart, responseStart, secureConnectionStart, unloadEventEnd, unloadEventEnd, unloadEventStart, unloadEventStart
-
Constructor Details
-
DefaultPerformanceTiming
public DefaultPerformanceTiming(org.openqa.selenium.WebDriver driver)
-
-
Method Details
-
getEventValue
Description copied from interface:PerformanceTiming
Returns the value for the argument event type.- Specified by:
getEventValue
in interfacePerformanceTiming
- Parameters:
event
- the event, never null- Returns:
- the event value
-
secureConnectionStart
Description copied from interface:PerformanceTiming
Returns the value that corresponds to thesecureConnectionStart
event.- Specified by:
secureConnectionStart
in interfacePerformanceTiming
- Returns:
- the epoch time for the
secureConnectionStart
event
-
getMetrics
Description copied from interface:PerformanceTiming
Return all timing metrics, in particular thewindow.performance.timing
object wrapped in aPerformanceTimingMetrics
object.- Specified by:
getMetrics
in interfacePerformanceTiming
- Returns:
- the performance timing metrics
-