1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-10-09 11:14:29 +02:00

Support non integers

This commit is contained in:
Gastón Fournier 2024-10-18 17:09:15 +02:00
parent 9bb125c8a3
commit c4580330ed
No known key found for this signature in database
GPG Key ID: AF45428626E17A8E

View File

@ -48,13 +48,13 @@ export class DbMetricsMonitor {
) { ) {
const resultArray = this.asArray(definition.map(result)); const resultArray = this.asArray(definition.map(result));
resultArray resultArray
.filter((r) => !Number.isInteger(r.value)) .filter((r) => typeof r.value !== 'number')
.forEach((r) => { .forEach((r) => {
this.log.warn( this.log.debug(
`Invalid value for ${definition.name}: ${r.value}. Value must be an integer.`, `Invalid value for ${definition.name}: ${r.value}. Value must be an number.`,
); );
}); });
return resultArray.filter((r) => Number.isInteger(r.value)); return resultArray.filter((r) => typeof r.value === 'number');
} }
return []; return [];
} }