Skip to content

Commit 1bc99bd

Browse files
Pigrabbitzbjornson
authored andcommitted
feat: update type declarations
1 parent 0a77ca1 commit 1bc99bd

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1818
### Added
1919

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

2223
## [15.0.0] - 2023-10-09
2324

index.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,19 @@ export class Histogram<T extends string = string> {
498498
*/
499499
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number;
500500

501+
/**
502+
* Start a timer with exemplar. Calling the returned function will observe the duration in
503+
* seconds in the histogram.
504+
* @param labels Object with label keys and values
505+
* @param exemplarLabels Object with label keys and values for exemplars
506+
* @return Function to invoke when timer should be stopped. The value it
507+
* returns is the timed duration.
508+
*/
509+
startTimer(
510+
labels?: LabelValues<T>,
511+
exemplarLabels?: LabelValues<T>,
512+
): (labels?: LabelValues<T>, exemplarLabels?: LabelValues<T>) => number;
513+
501514
/**
502515
* Reset histogram values
503516
*/

0 commit comments

Comments
 (0)