Skip to main content

Interface: ITelemetryConnector

Interface describing a telemetry connector.

Extends

  • IComponent

Methods

createMetric()

createMetric(metric): Promise<void>

Create a new metric.

Parameters

metric

ITelemetryMetric

The metric details.

Returns

Promise<void>

Nothing.


getMetric()

getMetric(id): Promise<{ metric: ITelemetryMetric; value: ITelemetryMetricValue; }>

Get the metric details and it's most recent value.

Parameters

id

string

The metric id.

Returns

Promise<{ metric: ITelemetryMetric; value: ITelemetryMetricValue; }>

The metric details and it's most recent value.


updateMetric()

updateMetric(metric): Promise<void>

Update metric.

Parameters

metric

Omit<ITelemetryMetric, "type">

The metric details.

Returns

Promise<void>

Nothing.


addMetricValue()

addMetricValue(id, value, customData?): Promise<string>

Update metric value.

Parameters

id

string

The id of the metric.

value

The value for the update operation.

number | "inc" | "dec"

customData?

The custom data for the update operation.

Returns

Promise<string>

The created metric value id.


removeMetric()

removeMetric(id): Promise<void>

Remove metric.

Parameters

id

string

The id of the metric.

Returns

Promise<void>

Nothing.


query()

query(type?, cursor?, pageSize?): Promise<{ entities: ITelemetryMetric[]; cursor?: string; }>

Query the metrics.

Parameters

type?

MetricType

The type of the metric.

cursor?

string

The cursor to request the next page of entities.

pageSize?

number

The maximum number of entities in a page.

Returns

Promise<{ entities: ITelemetryMetric[]; cursor?: string; }>

All the entities for the storage matching the conditions, and a cursor which can be used to request more entities.

Throws

NotImplementedError if the implementation does not support retrieval.


queryValues()

queryValues(id, timeStart?, timeEnd?, cursor?, pageSize?): Promise<{ metric: ITelemetryMetric; entities: ITelemetryMetricValue[]; cursor?: string; }>

Query the metric values.

Parameters

id

string

The id of the metric.

timeStart?

number

The inclusive time as the start of the metric entries.

timeEnd?

number

The inclusive time as the end of the metric entries.

cursor?

string

The cursor to request the next page of entities.

pageSize?

number

The maximum number of entities in a page.

Returns

Promise<{ metric: ITelemetryMetric; entities: ITelemetryMetricValue[]; cursor?: string; }>

All the entities for the storage matching the conditions, and a cursor which can be used to request more entities.

Throws

NotImplementedError if the implementation does not support retrieval.