diff --git a/system/metrics/sinks/CMakeLists.txt b/system/metrics/sinks/CMakeLists.txt index a46652b191c..d79f53e0871 100644 --- a/system/metrics/sinks/CMakeLists.txt +++ b/system/metrics/sinks/CMakeLists.txt @@ -1,5 +1,5 @@ ############################################################################### -# HPCC SYSTEMS software Copyright (C) 20214HPCC Systems®. +# HPCC SYSTEMS software Copyright (C) 2024 HPCC Systems®. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/system/metrics/sinks/elastic/elasticSink.cpp b/system/metrics/sinks/elastic/elasticSink.cpp index 0c3a4bba890..703f9cf9824 100644 --- a/system/metrics/sinks/elastic/elasticSink.cpp +++ b/system/metrics/sinks/elastic/elasticSink.cpp @@ -15,6 +15,8 @@ #include #include "platform.h" +#include "nlohmann/json.hpp" + using namespace hpccMetrics; extern "C" MetricSink* getSinkInstance(const char *name, const IPropertyTree *pSettingsTree) @@ -25,8 +27,7 @@ extern "C" MetricSink* getSinkInstance(const char *name, const IPropertyTree *pS ElasticMetricSink::ElasticMetricSink(const char *name, const IPropertyTree *pSettingsTree) : - PeriodicMetricSink(name, "file", pSettingsTree), - ignoreZeroMetrics(false) + PeriodicMetricSink(name, "elastic", pSettingsTree) { ignoreZeroMetrics = pSettingsTree->getPropBool("@ignoreZeroMetrics", true); } diff --git a/system/metrics/sinks/elastic/elasticSink.hpp b/system/metrics/sinks/elastic/elasticSink.hpp index 74dec839679..827169f3b13 100644 --- a/system/metrics/sinks/elastic/elasticSink.hpp +++ b/system/metrics/sinks/elastic/elasticSink.hpp @@ -33,9 +33,6 @@ #pragma GCC diagnostic pop #endif -#include "nlohmann/json.hpp" - - #ifdef ELASTICINK_EXPORTS #define ELASTICSINK_API DECL_EXPORT #else @@ -49,11 +46,11 @@ class ELASTICSINK_API ElasticMetricSink : public hpccMetrics::PeriodicMetricSink ~ElasticMetricSink() override = default; protected: - void prepareToStartCollecting() override; - void collectingHasStopped() override; - void doCollection() override; + virtual void prepareToStartCollecting() override; + virtual void collectingHasStopped() override; + virtual void doCollection() override; protected: StringBuffer indexName; - bool ignoreZeroMetrics; + bool ignoreZeroMetrics = false; };