Trending Data Channel

A TrendingDataChannel is any set of data and metadata that depends either on time directely or on some time dependent variable, like release number, version number etc.

The TrendingData provided by the TrendingDataChannel can either be in raw or statistical format.

A raw TrendingDataChannel is a channel that, for any interval on the trending axis, can provide all the changes ever recorded in its trending data. A statistical TrendingDataChannel is a channel that can only provide statistical (accumulated) information of the changes in its trendable data.
A raw TrendingDataChannel must always be able to provide data in statistical format. This feature is fundamental for performance reasons when requesting data over very long intervals in the trending axis where high levels of details are not necessary.
A TrendingDataChannel is not required to evaluate "accurate" statistical information over any time-variable interval; statistical data might be pre-calculated on some granularity and requests over a finer grid might obtain an approximated result.

The TrendingData returned by a TrendingDataChannel contains data and possibly metadata. The nature of the data and metadata depends on the format of the request. Raw TrendingData should contain raw values while statistical TrendingData should contain accumulated quantities like mean, rms, max value, min value etc.
The metadata is part of the TrendingData as it could also change over time.

The TrendingDataChannel can have one or more trending axis; the axis could be time, like milliseconds, Dates, Strings or any Object that defines some ordering for the TrendingData.

To retrieve some TrendingData it is necessary to provide a TrendingAxisSelection object.

TrendingDataChannel.java

public interface TrendingDataChannel {

    
    public static String VALUE        = "value";
    public static String ERROR        = "error";
    public static String ERROR_PLUS   = "error_plus";
    public static String ERROR_MINUS  = "error_minus";
    public static String MEAN         = "mean";
    public static String RMS          = "rms";
    public static String MAX_VALUE    = "max_value";
    public static String MIN_VALUE    = "min_value";
    public static String TIME         = "time";
    public static String WARNING_LOW  = "warning_low";
    public static String WARNING_HIGH = "warning_high";
    public static String ALARM_LOW    = "alarm_low";
    public static String ALARM_HIGH   = "alarm_high";
    
    
    /**
     * The name of this channel.
     *
     */
    public String getName();
    
    /**
     * Check if a given channel can provide raw TrendingData.
     *
     **/
    public boolean getHasRawTrendingData();
    
    /**
     * Get the names of the provided raw data and metadata.
     *
     */
    public String[] getRawTrendingDataNames();
    public String[] getRawTrendingMetaDataNames();
    
    /**
     * Get the types of the provided raw data and metadata.
     *
     */
    public Class[] getRawTrendingDataTypes();
    public Class[] getRawTrendingMetaDataTypes();

    /**
     * Get the names of the provided statistical data and metadata.
     *
     */
    public String[] getStatisticalTrendingDataNames();
    public String[] getStatisticalTrendingMetaDataNames();
    
    /**
     * Get the types of the provided statistical data and metadata.
     *
     */
    public Class[] getStatisticalTrendingDataTypes();
    public Class[] getStatisticalTrendingMetaDataTypes();

    /**
     * Get the names of the time axis for this channel.
     *
     */
    public String[] getTrendingAxisNames();
    
    /**
     * Get the types of the time axis for this channel.
     *
     */
    public Class[] getTrendingAxisTypes();
    
    /**
     * Get the TrendingData for a given TrendingAxisSelection.
     * The TrendingData is contained in a TrendingDataResult object.
     *
     */
    public TrendingDataResult getTrendingData(TrendingAxisSelection selection);
     
}

TrendingData

TrendingData contains data and metadata for a given time variable value.
The TrendingData could also be valid over a time interval.

TrendingData.java

public interface TrendingData {
    
    public static int RAW_DATA = 0;
    public static int STATISTICAL_DATA = 1;
    
    public void getData(String name, Value value);
    
    public void getMetaData(String name, Value value);
    
    public void getTrendingAxisValue(String name, Value value);
    
    public void getTrendingAxisLowerEdge(String name, Value value);

    public void getTrendingAxisUpperEdge(String name, Value value);
}

TrendingAxisSelection

This interface is a collection of selection intervals to be applied to a given trending axis. An interval can either be a lowerEdge-upperEdge pair of objects or a single value, in which case lowerEdge == upperEdge.
There is no garantee that the intervals are disjoined. It is up to the TrendingDataChannel object receiving the selection to use it in the best possible way.

The TrendingAxisSelection specifies the preferred data type (raw or statistical) to be stored in the result, but the TrendingDataChannel, depending of the size of the expected TrendingDataResult or other factors, might choose to ignore the preferred data type, returning a TrendingData of the type that yields the smaller result (or best performance).
A user is expected to always check the type of the TrendingDataResult.

The TrendingAxisSelection specifies the name of the axis on which to apply the selection and the binning (binning on run numbers is different than binning on time).

TrendingAxisSelection.java

public interface TrendingAxisSelection {
    
    /**
     * The name of the trending axis on which the selection is applied.
     *
     */
    public String getTrendingAxisName();

    /**
     * Get the desired type of data; it can either be TrendingData.RAW_DATA
     * or TrendingData.STATISTICAL_DATA.
     *
     */    
    public int getPreferredDataType();
    
    /**
     * The number of intervals in this selection.
     *
     */
    public int getNumberOfIntervals();
    
    /**
     * The number of suggested bins for one interval.
     *
     */
    public int getIntervalSuggestedBins(int i);    
    
    /**
     * The interval's upper edge.
     *
     */
    public void getIntervalUpperEdge(int i, Value value);

    /**
     * The interval's lower edge.
     *
     */
    public void getIntervalLowerEdge(int i, Value value);
    
}

TrendingDataResult

TrendingDataResult.java

public interface TrendingDataResult {
    
    /**
     * The type of TrendingData contained in the result.
     *
     */
    public int getTrendingDataType();
    
    /**
     * The TrendingData.
     *
     */
    public TrendingData[] getTrendingData();
    
}
  • No labels