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.
Timing | Value |
---|---|
6:00:00 | 0 |
6:59:59 | 0 |
7:00:00 | 1 |
9:59:59 | 1 |
10:00:00 | 0 |
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.
Requests Should Include the Start Time Value
When requesting a range of time, an ARDI driver should attempt to return the value that was current at the requested start time.
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, or supports mechanisms to provide similar functionality.
The timestamp of the previous value should be the query start value rather than a timestamp outside the requested query range.
In the case of analogue values, this value should be interpolated where appropriate.
It is not required to include the following value, although it is suggested when dealing with analogue values across sparse data.