Skip to content

Commit

Permalink
fix: linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Oct 15, 2024
1 parent 62d99ab commit b9b08bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class APM {
// prometheus stuff
// --------------------------------------------------------------
this.config.NORMALIZE_ENDPOINT = this.config.NORMALIZE_ENDPOINT === undefined ? true : this.config.NORMALIZE_ENDPOINT
if ([1, true, 'true', 'on', 'yes', undefined].indexOf(this.config.COLLECT_DEFAULT_METRICS) >= 0 ) {
if ([1, true, 'true', 'on', 'yes', undefined].indexOf(this.config.COLLECT_DEFAULT_METRICS) >= 0) {
const collectDefaultMetrics = this.client.collectDefaultMetrics
collectDefaultMetrics(this.config.PROM_CLIENT_CONF)
}
Expand Down
8 changes: 4 additions & 4 deletions tests/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ describe('prom-client integration', () => {
apm = new APM()
apm.init()
const data = await apm.client.register.metrics()
expect(data.includes("process_cpu_user_seconds_total")).toEqual(true)
});
expect(data.includes('process_cpu_user_seconds_total')).toEqual(true)
})

it('should support turning off default collection', async () => {
apm = new APM({ COLLECT_DEFAULT_METRICS: false })
apm.init()
const data = await apm.client.register.metrics()
expect(data.includes("process_cpu_user_seconds_total")).toEqual(false)
});
expect(data.includes('process_cpu_user_seconds_total')).toEqual(false)
})

it('should use custom config for prom', async () => {
apm = new APM({
Expand Down

0 comments on commit b9b08bd

Please sign in to comment.