Class: dataProcessingFeature

dataProcessingFeature($scope)

dataProcessingFeature feature

Implementation for a feature.
Makes use of the mediator pattern in order to subscribe the feature to the plugin's event, through the $scope reference which is passed to it.

Functionaliy

This feature is responsible for managing data from TimeSeries, process it,
and applying the specified statistic. Subscribed events
  • init-edit-mode
  • data-received
  • refresh

Constructor

new dataProcessingFeature($scope)

constructor - description
Important the use of _.cloneDeep to ensure that no two instances of the same plugin share references of the same variables.
Parameters:
Name Type Description
$scope type A reference to the plugin's scope for the subscription to events
Source:

Methods

(static) mapSeriesToValue(timeseries) → {Object}

mapSeriesToValue - Applies statistics to obtain a [metric, value] pair from a TimeSeries.
Parameters:
Name Type Description
timeseries Timeseries receives a timeseries object containing all values registered for a metric.
Source:
Returns:
Object containing both the name and value for a specific metric.
Type
Object

(static) onDataReceived(dataList)

onDataReceived - Handler for the event : data-received
When new data is received, it is converted into a simpler data structure;
then the selected statistic is applied to each of the metrics received.
Parameters:
Name Type Description
dataList type description
Source:

(static) onInitEditMode()

onInitEditMode - Handler for the event : init-edit-mode
Source:

(static) onRefresh()

onRefresh - Handler for the event : refresh
When configuration is modified, data is converted into a simpler data structure;
then the selected statistic is applied to each of the metrics received.
Previous data received, stored in the rawData attribute, is used.
Source:

(static) seriesHandler(dataList) → {TimeSeries}

seriesHandler - Extracts a simpler data structure.
Parameters:
Name Type Description
dataList type Original data structure
Source:
Returns:
TimeSeries created from the original one
Type
TimeSeries