@toolisticon/ssl-hostinfo-prometheus-exporter
Advanced tools
Comparing version 1.0.1-develop-28 to 1.0.1-develop-29
@@ -174,8 +174,21 @@ const moment = require('moment'); | ||
/** | ||
* Check for unallowed raw data contains, e.g. undefined data and normalize it | ||
* | ||
* @param {*} rawData | ||
*/ | ||
function normalizePrometheusDate (rawData) { | ||
if (rawData) { | ||
return `${rawData}\n`; | ||
} else { | ||
return ''; | ||
} | ||
} | ||
function renderMetrics () { | ||
let response = ''; | ||
Object.keys(resultStore).map((host) => { | ||
response += `${resultStore[host].moz}\n`; | ||
response += `${resultStore[host].details}\n`; | ||
response += `${resultStore[host].expire}\n`; | ||
response += `${normalizePrometheusDate(resultStore[host].moz)}`; | ||
response += `${normalizePrometheusDate(resultStore[host].details)}`; | ||
response += `${normalizePrometheusDate(resultStore[host].expire)}`; | ||
}); | ||
@@ -182,0 +195,0 @@ return response; |
{ | ||
"name": "@toolisticon/ssl-hostinfo-prometheus-exporter", | ||
"version": "1.0.1-develop-28", | ||
"version": "1.0.1-develop-29", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
33822
362