-
-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
155 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,4 @@ | ||
import BaseMetric = require("./base"); | ||
import GaugeMetric = require("./gauge"); | ||
|
||
declare namespace CounterMetric { | ||
export interface CounterMetricSnapshot { | ||
value: number; | ||
labels: Record<string, any>; | ||
timestamp: number; | ||
} | ||
} | ||
|
||
declare class CounterMetric extends BaseMetric<CounterMetric.CounterMetricSnapshot> { | ||
increment(labels?: Record<string, any>, value?: number, timestamp?: number): void; | ||
|
||
set(value: number, labels?: Record<string, any>, timestamp?: number): void; | ||
|
||
generateSnapshot(): CounterMetric.CounterMetricSnapshot[]; | ||
} | ||
declare class CounterMetric extends GaugeMetric {} | ||
export = CounterMetric; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
import BaseMetric = require("./base"); | ||
import type MetricRegistry = require("../registry"); | ||
|
||
declare namespace GaugeMetric { | ||
export interface GaugeMetricSnapshot { | ||
key: string; | ||
value: number; | ||
labels: Record<string, any>; | ||
timestamp: number; | ||
} | ||
} | ||
|
||
declare class GaugeMetric extends BaseMetric<GaugeMetric.GaugeMetricSnapshot> { | ||
constructor(opts: BaseMetric.BaseMetricOptions, registry: MetricRegistry); | ||
|
||
increment(labels?: Record<string, any>, value?: number, timestamp?: number): void; | ||
|
||
decrement(labels?: Record<string, any>, value?: number, timestamp?: number): void; | ||
|
||
set(value: number, labels?: Record<string, any>, timestamp?: number): void; | ||
|
||
reset(labels?: Record<string, any>, timestamp?: number): void; | ||
|
||
resetAll(timestamp?: number): void; | ||
|
||
generateSnapshot(): GaugeMetric.GaugeMetricSnapshot[]; | ||
} | ||
export = GaugeMetric; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.