Show / Hide Table of Contents

Class Datapoint

Data point abstraction. Consists of a timestamp and a double or string value

Inheritance
object
Datapoint
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extensions
Assembly: Cognite.Extensions.dll
Syntax
public class Datapoint

Constructors

| Edit this page View Source

Datapoint(DateTime, bool, StatusCode?, bool)

Creates a data point without a value. You still need to specify whether the time series it is being written to is a string or numeric time series. Default quality is bad.

Declaration
public Datapoint(DateTime timestamp, bool isString, StatusCode? statusCode = null, bool isState = false)
Parameters
Type Name Description
DateTime timestamp

Timestamp

bool isString

Whether the time series is string.

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

bool isState

Whether the time series is a state time series.

| Edit this page View Source

Datapoint(DateTime, double, StatusCode?)

Creates a numeric data point

Declaration
public Datapoint(DateTime timestamp, double numericValue, StatusCode? statusCode = null)
Parameters
Type Name Description
DateTime timestamp

Timestamp

double numericValue

double value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(DateTime, double, string, StatusCode?)

Creates a state data point with a string and numeric value. This is used for the beta state timeseries endpoint.

Declaration
public Datapoint(DateTime timestamp, double numericValue, string str, StatusCode? statusCode = null)
Parameters
Type Name Description
DateTime timestamp

Timestamp

double numericValue

double value

string str

string value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(DateTime, string?, StatusCode?)

Creates a string data point

Declaration
public Datapoint(DateTime timestamp, string? stringValue, StatusCode? statusCode = null)
Parameters
Type Name Description
DateTime timestamp

Timestamp

string stringValue

string value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(long, bool, StatusCode?, bool)

Creates a data point without a value. You still need to specify whether the time series it is being written to is a string or numeric time series.

Declaration
public Datapoint(long timestamp, bool isString, StatusCode? statusCode = null, bool isState = false)
Parameters
Type Name Description
long timestamp

Timestamp

bool isString

Whether the time series is string.

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

bool isState

Whether the time series is a state time series.

| Edit this page View Source

Datapoint(long, double, StatusCode?)

Creates a numeric data point

Declaration
public Datapoint(long timestamp, double numericValue, StatusCode? statusCode = null)
Parameters
Type Name Description
long timestamp

Timestamp

double numericValue

double value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(long, double?, string?, StatusCode?)

Creates a state data point with a string and/or numeric value. This is used for the beta state timeseries endpoint.

Declaration
public Datapoint(long timestamp, double? numericValue, string? str, StatusCode? statusCode = null)
Parameters
Type Name Description
long timestamp

Timestamp

double? numericValue

double value

string str

string value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

| Edit this page View Source

Datapoint(long, string?, StatusCode?)

Creates a string data point

Declaration
public Datapoint(long timestamp, string? stringValue, StatusCode? statusCode = null)
Parameters
Type Name Description
long timestamp

Timestamp

string stringValue

string value

StatusCode? statusCode

BETA: set the data point status code. This is only used if the beta datapoints endpoint is used.

Properties

| Edit this page View Source

IsState

True if datapoint is a state datapoint, carrying both a numeric and a string value. This is used for the beta state timeseries endpoint.

Declaration
public bool IsState { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsString

True if datapoint is string

Declaration
public bool IsString { get; }
Property Value
Type Description
bool
| Edit this page View Source

NumericValue

Optional double value

Declaration
public double? NumericValue { get; }
Property Value
Type Description
double?
| Edit this page View Source

Status

Datapoint status code.

Declaration
public StatusCode Status { get; }
Property Value
Type Description
StatusCode
| Edit this page View Source

StringValue

Optional string value

Declaration
public string? StringValue { get; }
Property Value
Type Description
string
| Edit this page View Source

Timestamp

Timestamp in Unix time milliseconds

Declaration
public long Timestamp { get; }
Property Value
Type Description
long

Methods

| Edit this page View Source

FromStream(Stream)

Initializes Datapoint by reading from a stream. Requires that the next bytes in the stream represent a datapoint.

Declaration
public static Datapoint? FromStream(Stream stream)
Parameters
Type Name Description
Stream stream

Stream to read from

Returns
Type Description
Datapoint
| Edit this page View Source

ToStorableBytes()

Convert datapoint into an array of bytes on the form [long timestamp][byte kind (0 = numeric, 1 = string, 2 = state)][ulong statusCode] {[double value] or [ushort length][string value] or [double value][ushort length][string value]}. The kind byte occupies the same slot and size as the old boolean isString flag, so existing numeric (0)/string (1) records on disk remain readable.

Declaration
public byte[] ToStorableBytes()
Returns
Type Description
byte[]

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
Sanitation.Sanitize(Datapoint, double?)
Sanitation.Verify(Datapoint)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX