-
Notifications
You must be signed in to change notification settings - Fork 428
Don't zero out Gauges. #813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,12 +138,13 @@ describe.each([ | |
| expect(fn).toThrowErrorMatchingSnapshot(); | ||
| }); | ||
|
|
||
| it('should init to 0', async () => { | ||
| it('should not init to 0', async () => { | ||
| instance = new Gauge({ | ||
| name: 'init_gauge', | ||
| help: 'somehelp', | ||
| }); | ||
| await expectValue(0); | ||
|
|
||
| await expect(instance.get()).resolves.toBeEmpty; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. claude claims this is no-op, should be something like |
||
| }); | ||
|
|
||
| describe('with labels', () => { | ||
|
|
@@ -287,6 +288,7 @@ describe.each([ | |
| afterEach(() => { | ||
| globalRegistry.clear(); | ||
| }); | ||
|
|
||
| it('should reset labelless gauge', async () => { | ||
| const instance = new Gauge({ | ||
| name: 'test_metric', | ||
|
|
@@ -297,7 +299,7 @@ describe.each([ | |
| expect((await instance.get()).values[0].value).toEqual(12); | ||
|
|
||
| instance.reset(); | ||
| expect((await instance.get()).values[0].value).toEqual(0); | ||
| expect(await instance.get()).toBeEmpty; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. claude claims this is no-op, should be something like expect((await instance.get()).values).toEqual([]); |
||
|
|
||
| instance.set(10); | ||
| expect((await instance.get()).values[0].value).toEqual(10); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.