(context: Context.Context<never>)
| 1760 | } |
| 1761 | return makeHooks(() => ({ count, incremental: this.#incremental }), update) |
| 1762 | } |
| 1763 | } |
| 1764 | |
| 1765 | class GaugeMetric<Input extends number | bigint> extends Metric$<Input, GaugeState<Input>> { |
| 1766 | readonly type = "Gauge" |
| 1767 | readonly #bigint: boolean |
| 1768 | |
| 1769 | constructor(id: string, options?: { |
| 1770 | readonly description?: string | undefined |
| 1771 | readonly attributes?: Metric.Attributes | undefined |
| 1772 | readonly bigint?: boolean | undefined |
| 1773 | }) { |
| 1774 | super(id, options?.description, attributesToRecord(options?.attributes)) |
| 1775 | this.#bigint = options?.bigint ?? false |
| 1776 | } |
| 1777 | |
| 1778 | createHooks(): Metric.Hooks<Input, GaugeState<Input>> { |
| 1779 | let value = this.#bigint ? BigInt(0) as any : 0 |
| 1780 | const update = (input: number | bigint) => { |
| 1781 | value = input |
| 1782 | } |
no test coverage detected
searching dependent graphs…