fix formatting of metrics

This commit is contained in:
Jakub Sokołowski 2018-11-15 14:48:34 +01:00
parent 98d3384b33
commit 1c36339db7
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ const metricsHeader = `
# Counts of clicks for every key available in the service store. # Counts of clicks for every key available in the service store.
# HELP ${metricsName} List of clicks for counted for every key. # HELP ${metricsName} List of clicks for counted for every key.
# TYPE ${metricsName} counter # TYPE ${metricsName} counter
` `.trim()
class Counter { class Counter {
constructor(redis, name) { constructor(redis, name) {
@ -39,7 +39,7 @@ class Counter {
let metricsFormatted = Object.keys(metrics).map((key) => ( let metricsFormatted = Object.keys(metrics).map((key) => (
`${metricsName}{key="${key}"} ${metrics[key]}` `${metricsName}{key="${key}"} ${metrics[key]}`
)) ))
return metricsHeader + metricsFormatted.join('\n') return metricsHeader + '\n' + metricsFormatted.join('\n')
} }
} }