in_windows_exporter_metrics: cpu: Don't compare float values directly
We should compare via fabsf and FLB_EPLISON for two float values.
Otherwise, we encountered missing metrics for the newer Windows platform.
#include <fluent-bit/flb_error.h>
#include <fluent-bit/flb_pack.h>
+#include <float.h>
+
#include "we.h"
#include "we_cpu.h"
#include "we_util.h"
@@ -221,7 +223,7 @@ int we_cpu_init(struct flb_we *ctx)
return -2;
}
- if (ctx->windows_version >= 6.05) {
+ if (fabsf(ctx->windows_version - 6.05) > FLT_EPSILON) {
metric_sources = full_metric_sources;
ctx->cpu.query = (char *) "Processor Information";
}
