Constructor
new PerformanceTimingTracker()
Setup the local reference to the performance api as well as setup a local
datastore for storing any custom metrics
Methods
extractMetrics() → {JSON}
Flatten the performance api metrics and custom metrics and return the
combined object as a JSON object
Returns:
- Type
- JSON
get(key) → {Any|Null}
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}
Verfies if some input value correspond to the type 'number'
Returns:
- Type
- Boolean
isUndefined() → {Boolean}
Verfies if some input value correspond to the type 'undefined'
Returns:
- Type
- Boolean
set(key, value)
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)
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 |