MetricBuilder
Defined in: builder/metric.ts:56
A builder for defining a metric in the Alpyne system.
Extends
Section titled “Extends”Properties
Section titled “Properties”dimensions
Section titled “dimensions”
readonlydimensions:Record<string, {dimension:MetricDimensionBuilder;handler:MetricDimensionHandler; }>
Defined in: builder/metric.ts:57
readonlyprn:string
Defined in: builder/index.ts:32
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”addDimension()
Section titled “addDimension()”addDimension(
dimension,position,handler):this
Defined in: builder/metric.ts:70
Adds a dimension to this metric. Dimensions are a means of breaking down and bucketing the metric when it is being queried.
All dimensions boil down to a string value. Each dimension has a handler that converts a single event into the given dimension. A read runtime is provided to allow broader interrogation of the context of the event.
The limit on the number of dimensions is defined in LIMIT-11.
Parameters
Section titled “Parameters”dimension
Section titled “dimension”position
Section titled “position”1 | 2 | 3 | 4
handler
Section titled “handler”Returns
Section titled “Returns”this
addEvent()
Section titled “addEvent()”addEvent(
event,handler?):this
Defined in: builder/metric.ts:81
Adds an event to this metric. The handler calculates the value for this event. For example if it was a CPU usage event it may emit the load level “0.1”.
If the handler is not supplied, all events map to “1” and thus it is simply a count of events. This is expected to be the most common case.
Parameters
Section titled “Parameters”handler?
Section titled “handler?”Returns
Section titled “Returns”this
addGrant()
Section titled “addGrant()”addGrant(
role):MetricGrant
Defined in: builder/metric.ts:86
Grants the supplied App Role access to this metric.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”setDescription()
Section titled “setDescription()”setDescription(
description):this
Defined in: builder/index.ts:33
Parameters
Section titled “Parameters”description
Section titled “description”string
Returns
Section titled “Returns”this