PerformanceTimingTracker

Viki. PerformanceTimingTracker

Tracks for the local performance metrics of the user's browser Uses the PerformanceTimingApi, along with getter / setter to add our own values to this mix of stats

Constructor

new PerformanceTimingTracker()

Source:
Setup the local reference to the performance api as well as setup a local datastore for storing any custom metrics

Methods

extractMetrics() → {JSON}

Source:
Flatten the performance api metrics and custom metrics and return the combined object as a JSON object
Returns:
Type
JSON

get(key) → {Any|Null}

Source:
Retrive some metric value with an identifying key
Parameters:
Name Type Description
key String Identifier corresponding to the property that is stored
Returns:
The corresponding value to the requested key, or null if not found
Type
Any | Null

isNumerical() → {Boolean}

Source:
Verfies if some input value correspond to the type 'number'
Returns:
Type
Boolean

isUndefined() → {Boolean}

Source:
Verfies if some input value correspond to the type 'undefined'
Returns:
Type
Boolean

set(key, value)

Source:
Save some custom metric value with an identifying key
Parameters:
Name Type Description
key String Identifier corresponding to the property to be stored
value Any Any value type that can be stored as part of a custom metric

setDifferenceAsValue(firstKey, secondKey, newKey)

Source:
Save some custom metric value with an identifying key
Parameters:
Name Type Description
firstKey String Identifier corresponding to the primary value to be compared
secondKey String Identifier corresponding to the secondary value to be compared
newKey String Identifier for saving the difference in retrieved values