-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DB - Removed some template code and also tests to metrics helper
- Loading branch information
David Boyne
authored and
David Boyne
committed
May 15, 2018
1 parent
61c096d
commit 30bf2e1
Showing
4 changed files
with
40 additions
and
28 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { raiseMetric } = require('./'); | ||
|
||
describe('metrics helper', () => { | ||
|
||
describe('raiseMetric', () => { | ||
|
||
it('sets a new promethus Gauge with the given name, product and value', () => { | ||
|
||
const metrics = raiseMetric('test', 'test-product', 10); | ||
|
||
expect(metrics['test']).toEqual(expect.objectContaining({ | ||
name: 'test', | ||
labelNames: ['product'], | ||
help: 'metric_help', | ||
aggregator: 'sum', | ||
hashMap: { | ||
'product:test-product': expect.objectContaining({ | ||
value: 10 | ||
}) | ||
} | ||
})); | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); |