Class DefaultPerformanceTimingMetrics
- All Implemented Interfaces:
PerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
PerformanceTimingMetrics
storing the metrics value as a Map
.
It also provides an option to convert all values in the current object to an arbitrary TimeUnit
.
For that you can call in(TimeUnit)
on the current object.
The values returned from this object are not epoch values as querying the corresponding
Javascript attribute
directly would return, but it rather handles navigationStart
as zero and returns
time values passed
since that point in time.
Take into account that when there is a time difference like 1675ms
, and it is
converted to e.g. seconds,
the conversion will return 1sec
for that instead of rounding it up to
2sec
.
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.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionDefaultPerformanceTimingMetrics
(Map<String, Object> timingMetrics) Creates a newDefaultPerformanceTimingMetrics
object from the argument epoch values.protected
DefaultPerformanceTimingMetrics
(Map<String, Object> timingMetrics, TimeUnit timeUnit) Creates a newDefaultPerformanceTimingMetrics
object from the argument metrics (in the given time unit). -
Method Summary
Modifier and TypeMethodDescriptionlong
long
long
long
long
long
long
long
long
long
long
long
long
long
long
long
long
long
According to the official documentation of the secureConnectionStart attribute this attribute is optional and may be set asundefined
.long
long
Returns a new metrics object having all metric values converted to the targetTimeUnit
.
-
Constructor Details
-
DefaultPerformanceTimingMetrics
Creates a newDefaultPerformanceTimingMetrics
object from the argument epoch values.It calculates and converts the epoch values into the differences/times passed since
navigationStart
.- Parameters:
timingMetrics
- the timing metrics in epoch
-
DefaultPerformanceTimingMetrics
Creates a newDefaultPerformanceTimingMetrics
object from the argument metrics (in the given time unit).- Parameters:
timingMetrics
- the metricstimeUnit
- the time unit of the metrics
-
-
Method Details
-
in
Returns a new metrics object having all metric values converted to the targetTimeUnit
.Values that can have other than long values are converted if they are
long
values, otherwise added to the new metrics object unchanged.- Specified by:
in
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
- Parameters:
targetTimeUnit
- the time unit to convert the metrics to- Returns:
- the converted metrics object
-
getAllMetrics
-
getSourceTimeUnit
-
getUnloadEventStart
public long getUnloadEventStart()- Specified by:
getUnloadEventStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getUnloadEventEnd
public long getUnloadEventEnd()- Specified by:
getUnloadEventEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getRedirectStart
public long getRedirectStart()- Specified by:
getRedirectStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getRedirectEnd
public long getRedirectEnd()- Specified by:
getRedirectEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getFetchStart
public long getFetchStart()- Specified by:
getFetchStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomainLookupStart
public long getDomainLookupStart()- Specified by:
getDomainLookupStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomainLookupEnd
public long getDomainLookupEnd()- Specified by:
getDomainLookupEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getConnectStart
public long getConnectStart()- Specified by:
getConnectStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getConnectEnd
public long getConnectEnd()- Specified by:
getConnectEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getSecureConnectionStart
Description copied from interface:PerformanceTimingMetrics
According to the official documentation of the secureConnectionStart attribute this attribute is optional and may be set asundefined
.It is up to the user of this method to check whether it is present and convert it accordingly.
- Specified by:
getSecureConnectionStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
- Returns:
- the metrics value
-
getRequestStart
public long getRequestStart()- Specified by:
getRequestStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getResponseStart
public long getResponseStart()- Specified by:
getResponseStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getResponseEnd
public long getResponseEnd()- Specified by:
getResponseEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomLoading
public long getDomLoading()- Specified by:
getDomLoading
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomInteractive
public long getDomInteractive()- Specified by:
getDomInteractive
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomContentLoadedEventStart
public long getDomContentLoadedEventStart()- Specified by:
getDomContentLoadedEventStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomContentLoadedEventEnd
public long getDomContentLoadedEventEnd()- Specified by:
getDomContentLoadedEventEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getDomComplete
public long getDomComplete()- Specified by:
getDomComplete
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getLoadEventStart
public long getLoadEventStart()- Specified by:
getLoadEventStart
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-
getLoadEventEnd
public long getLoadEventEnd()- Specified by:
getLoadEventEnd
in interfacePerformanceTimingMetrics<DefaultPerformanceTimingMetrics>
-