Class DefaultPerformanceTiming
- java.lang.Object
-
- org.fluentlenium.core.performance.DefaultPerformanceTiming
-
- All Implemented Interfaces:
PerformanceTiming
public class DefaultPerformanceTiming extends java.lang.Object implements PerformanceTiming
Default implementation ofPerformanceTiming
.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 handlesnavigationStart
as zero and returns time values passed since that point in time.This implementation executes the query (
window.performance.timing.
) with a simpleJavascriptExecutor
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
Constructors Constructor Description DefaultPerformanceTiming(org.openqa.selenium.WebDriver driver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getEventValue(PerformanceTimingEvent event)
Returns the value for the argument event type.PerformanceTimingMetrics
getMetrics()
Return all timing metrics, in particular thewindow.performance.timing
object wrapped in aPerformanceTimingMetrics
object.java.lang.Object
secureConnectionStart()
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 org.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
-
-
-
-
Method Detail
-
getEventValue
public long getEventValue(PerformanceTimingEvent event)
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
public java.lang.Object 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
public PerformanceTimingMetrics 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
-
-