ARDI Driver Guidelines

ARDI historical drivers have a set of guidelines that every history driver is supposed to follow if at all possible.

No Point Should Have Overlapping Timestamps

History drivers should not produce two values for the exact same timestamp. If there is a transition in a discrete state (ie. a boolean value changing from 'false' to 'true'), these two points should be offset by a small amount of time (ie. 0.1 seconds).

This ensures that the data is still meaningful and can be understood should it ever be sorted by time.

Discrete Data Should Not Be Interpolated

If data is discrete (integer, boolean or text), it should not be interpolated, even if the user is requesting interpolated data.

When working with discrete data - such as when 1 means 'forwards' and 2 means 'error' - interpolating that value to 1.5 is meaningless. As such, drivers should avoid it and return discrete data changes as if raw (un-interpolated) data was requested.

Discrete Data Should Be Stepped

If the driver provides discrete data, points should be inserted (if required) to 'step' the data.

For example, if a boolean channel begins at 0 at 6:00AM, changes to 1 at 7:00AM, and back to 0 at 10:00AM, the feed should contain at least five samples.

TimingValue
6:00:000
6:59:590
7:00:001
9:59:591
10:00:000

This ensures that any plot of the discrete data is clearly stepped. This way, even if the user attempts to interpolate this data, they will be given accurate results.

Responses Should Include Values for Start Time and End Time

When requesting a range of time, an ARDI driver should attempt to return the value that was current at the requested start time, and the value that was valid at the end time.

If this value didn't change during the full time-frame, it should still return two records for start and end of the time-frame.

This can be challenging in situations where data is asynchronous, sparse or only reported by-exception. It can cause the driver to run quite slowly with non-time-series data sources, such as traditional RDBMS systems.

However, it is expected that all drivers attempt to do this.

Note that if an exact sample time isn't available, the 'start' and 'end' samples times should not exceed the requested time frame, even if the sample was taken outside the time-range.

In the case of analogue values, this value should be interpolated where appropriate.

Try To Interpolate/Aggregate Where Possible

If your data source supports the ability to aggregate/average values in order to achieve a reduced or specific resolution (ie. returning 1000 samples across the day rather than 840000), it should do so when the query type is 'interp'.