Interface ISampleCollection
Properties of a sample collection
Namespace: MESL.SqlRace.Domain.Infrastructure.DataPipeline
Assembly: MESL.SqlRace.Domain.dll
Syntax
public interface ISampleCollection
Properties
Count
Sample count
Declaration
long Count { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Item[Int32]
Get sample at index
Declaration
Sample this[int i] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | i | Sample index |
Property Value
Type | Description |
---|---|
Sample | Sample at index |
Methods
Add(Sample)
Add a sample
Declaration
void Add(Sample data)
Parameters
Type | Name | Description |
---|---|---|
Sample | data | Sample to add |
Add(Double, Int64, DataStatusType)
Add a sample
Declaration
void Add(double data, long timestamp, DataStatusType dataStatus)
Parameters
Type | Name | Description |
---|---|---|
System.Double | data | Sample data |
System.Int64 | timestamp | Sample timestamp |
DataStatusType | dataStatus | Sample status |
GetSamplesInTimeRange(Int64, Int64, Action<Sample>)
Act on samples in range
Declaration
void GetSamplesInTimeRange(long startTimestamp, long endTimestamp, Action<Sample> addSample)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | startTimestamp | Sample start time |
System.Int64 | endTimestamp | Sample end time |
System.Action<Sample> | addSample | Action to execute on samples |
PeekNextSample()
View next sample
Declaration
Sample PeekNextSample()
Returns
Type | Description |
---|---|
Sample | Next sample |
PeekSampleAtOrBefore(Int64)
View sample at or before timestamp
Declaration
Sample PeekSampleAtOrBefore(long timestamp)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | timestamp | Timestamp of sample |
Returns
Type | Description |
---|---|
Sample | Sample at or before timestamp |
PreviousSample()
View previous sample
Declaration
Sample PreviousSample()
Returns
Type | Description |
---|---|
Sample | Previous sample |
Release()
Release any resources used by sample collection
Declaration
void Release()
SamplesInTimeRange(Int64, Int64)
Get samples in range
Declaration
IEnumerable<Sample> SamplesInTimeRange(long startTimestamp, long endTimestamp)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | startTimestamp | Sample start time |
System.Int64 | endTimestamp | Sample end time |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Sample> | Samples |
ToArrays(Double[], Int64[], DataStatusType[])
Convert sample collection to arrays
Declaration
void ToArrays(double[] data, long[] time, DataStatusType[] status)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | data | Data array |
System.Int64[] | time | Timestamp array |
DataStatusType[] | status | Data status array |
UpdateSampleStatus(Int32, DataStatusType)
Update the status of a sample
Declaration
void UpdateSampleStatus(int index, DataStatusType newStatus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Sample index |
DataStatusType | newStatus | New status for sample |