Options
All
  • Public
  • Public/Protected
  • All
Menu

ts-s3-metrics

Index

Type aliases

MergeArraysFn

MergeArraysFn: (oldValues: Metric[], newValues: Metric[]) => Metric[]

Type for a function merging two arrays together.

Type declaration

MergeValuesFn

MergeValuesFn: (oldValue: Metric, newValue: Metric) => Metric[]

Type for a function merging two values with the same time together.

Type declaration

ReadFunction

ReadFunction: (key: MetricKey, from: Date, to: Date) => Promise<Metric[]>

Type declaration

Variables

Const mergeRawMetricsWithMerge

mergeRawMetricsWithMerge: (oldValues: Metric[], newValues: Metric[]) => Metric[] = createMergeFunction((oldValue, newValue) => [oldValue, newValue])

Merges the two metrics arrays. If a value is found at the same time, both values will be used.

Type declaration

Const mergeRawMetricsWithOverride

mergeRawMetricsWithOverride: (oldValues: Metric[], newValues: Metric[]) => Metric[] = createMergeFunction((oldValue, newValue) => [newValue])

Merges the two metrics arrays. If a value is found at the same time, only the value from the newValues array will be used.

Type declaration

Const mergeRawMetricsWithThrow

mergeRawMetricsWithThrow: (oldValues: Metric[], newValues: Metric[]) => Metric[] = createMergeFunction((oldValue, newValue) => {throw Error('Duplicate value found!');})

Merges the two metrics arrays. If a value is found at the same time an exception is thrown.

Type declaration

Functions

createMergeFunction

  • Used to create a merge function for two arrays. The provided function handles when both arrays have an item with the same timestamp.

    Parameters

    Returns MergeArraysFn

createMetricNow

  • createMetricNow(value: number): Metric

mergeArrays

metricFromString

  • metricFromString(raw: string): Metric

metricToString

  • metricToString(metric: Metric): string

sleep

  • sleep(ms: number): Promise<unknown>

Generated using TypeDoc