The collector class handles the collection and storage of data into the appropriate array. The collector also handles notifying any observers of any updates.
ObservableSearch playground for datasetObservable
An observable you can attach to get deltas in the dataset. Subscribing to this will increase memory consumption slightly, and may hurt performance due to increased garbage collection needed. Updates of slices will be of the form [timestamp, numberOfPoints, value1, value2...].
Readonly datasetsSearch playground for datasets
Datastructure containing the collected datasets. Warning: you should not modify the values in here, data will be of the form [timestamp, numberOfPoints, value1, value2..., timestamp, etc...]
ObservableSearch playground for metadataObservable
An observable you can attach to get the most updated map of metadatas.
Accessor which lets the caller know if the performance collector has data loaded from a file or not! Call clear() to reset this value.
true if the data is loaded from a file, false otherwise.
Returns if the perf collector has been started or not.
The offset for the value of the number of points inside a slice.
The offset for when actual data values start appearing inside a slice.
Collection StrategiesSearch playground for addCollectionStrategies
This method adds additional collection strategies for data collection purposes.
Rest ...strategyCallbacks: IPerformanceViewerStrategyParameter
the list of data to collect with callbacks.
Completely clear, data, ids, and strategies saved to this performance collector.
Optional preserveStringEventsRestore: boolean
if it should preserve the string events, by default will clear string events registered when called.
Disposes of the object
Data To CsvSearch playground for exportDataToCsv
Exports the datasets inside of the collector to a csv.
Current SliceSearch playground for getCurrentSlice
Collects and then sends the latest slice to any observers by using the appropriate strategy when the user wants. The slice will be of the form [timestamp, numberOfPoints, value1, value2...] This method does not add onto the collected data accessible via the datasets variable.
From File DataSearch playground for loadFromFileData
Given a string containing file data, this function parses the file data into the datasets object. It returns a boolean to indicate if this object was successfully loaded with the data.
string content representing the file data.
Optional keepDatasetMeta: boolean
if it should use reuse the existing dataset metadata
true if the data was successfully loaded, false otherwise.
EventSearch playground for registerEvent
Registers a custom string event which will be callable via sendEvent. This method returns an event object which will contain the id of the event. The user can set a value optionally, which will be used in the sendEvent method. If the value is set, we will record this value at the end of each frame, if not we will increment our counter and record the value of the counter at the end of each frame. The value recorded is 0 if no sendEvent method is called, within a frame.
The name of the event to register
Optional forceUpdate: boolean
if the code should force add an event, and replace the last one.
Optional category: string
the category for that event
Returns undefined | IPerfCustomEvent
The event registered, used in sendEvent
EventSearch playground for sendEvent
Lets the perf collector handle an event, occurences or event value depending on if the event.value params is set.
the event to handle an occurence for
Starts the realtime collection of data.
Optional shouldPreserve: boolean
optional boolean param, if set will preserve the dataset between calls of start.
Stops the collection of data.