Skip to content

Commit

Permalink
feat: update type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Pigrabbit authored and zbjornson committed Nov 25, 2023
1 parent 0a77ca1 commit 1bc99bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
### Added

- Allow Pushgateway to now require job names for compatibility with Gravel Gateway.
- Allow `histogram.startTime()` to be used with exemplars.

## [15.0.0] - 2023-10-09

Expand Down
13 changes: 13 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,19 @@ export class Histogram<T extends string = string> {
*/
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number;

/**
* Start a timer with exemplar. Calling the returned function will observe the duration in
* seconds in the histogram.
* @param labels Object with label keys and values
* @param exemplarLabels Object with label keys and values for exemplars
* @return Function to invoke when timer should be stopped. The value it
* returns is the timed duration.
*/
startTimer(
labels?: LabelValues<T>,
exemplarLabels?: LabelValues<T>,
): (labels?: LabelValues<T>, exemplarLabels?: LabelValues<T>) => number;

/**
* Reset histogram values
*/
Expand Down

0 comments on commit 1bc99bd

Please sign in to comment.