From 4d81470f88e402653abbdbf2d5b8d310214d801c Mon Sep 17 00:00:00 2001 From: Adam Wegrzynek Date: Thu, 29 Nov 2018 13:01:37 +0100 Subject: [PATCH] Drop setTimestamp method (#94) --- CMakeLists.txt | 1 - examples/3-UserDefinedTimestamp.cxx | 25 ------------------------- include/Monitoring/Metric.h | 5 ----- src/Metric.cxx | 6 ------ 4 files changed, 37 deletions(-) delete mode 100644 examples/3-UserDefinedTimestamp.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index f5dbd83c5..9e66f19e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,6 @@ target_compile_features(Monitoring PUBLIC cxx_std_17) set(EXAMPLES examples/1-Basic.cxx examples/2-TaggedMetrics.cxx - examples/3-UserDefinedTimestamp examples/4-RateDerivedMetric.cxx examples/5-Benchmark.cxx examples/6-Increment.cxx diff --git a/examples/3-UserDefinedTimestamp.cxx b/examples/3-UserDefinedTimestamp.cxx deleted file mode 100644 index 2a4224ad2..000000000 --- a/examples/3-UserDefinedTimestamp.cxx +++ /dev/null @@ -1,25 +0,0 @@ -/// -/// \file 3-UserDefinedTimestamp.cxx -/// \author Adam Wegrzynek -/// - -#include "Monitoring/MonitoringFactory.h" - -using Monitoring = o2::monitoring::MonitoringFactory; -using o2::monitoring::Metric; - -int main() { - // Configure monitoring - // Pass string with list of URLs as parameter - auto monitoring = Monitoring::Get("stdout://"); - - // current timestamp - std::chrono::time_point timestamp = std::chrono::system_clock::now(); - - // now send an application specific metric - // 10 is the value timestamp - // myCrazyMetric is the name of the metric - monitoring->send(Metric{10, "myCrazyMetric"}.setTimestamp(timestamp)); - std::this_thread::sleep_for(std::chrono::seconds(1)); - monitoring->send(Metric{40, "myCrazyMetric"}.setTimestamp(timestamp)); -} diff --git a/include/Monitoring/Metric.h b/include/Monitoring/Metric.h index 2740311ab..829a7c1b4 100644 --- a/include/Monitoring/Metric.h +++ b/include/Monitoring/Metric.h @@ -87,11 +87,6 @@ class Metric /// \return vector of tags std::vector getTags() const; - /// Sets user defined timestamp - /// \param timestamp timestamp to set - /// \return r-value to "this" - to be able to chain methods - Metric&& setTimestamp(std::chrono::time_point& timestamp); - /// Add user defined tags /// \param tags r-value to vector of tags /// \return r-value to "this" - to be able to chain methods diff --git a/src/Metric.cxx b/src/Metric.cxx index 8c70022d1..99812b997 100644 --- a/src/Metric.cxx +++ b/src/Metric.cxx @@ -90,12 +90,6 @@ Metric&& Metric::addTags(std::vector&& tags) return std::move(*this); } -Metric&& Metric::setTimestamp(std::chrono::time_point& timestamp) -{ - mTimestamp = timestamp; - return std::move(*this); -} - std::vector Metric::getTags() const { return tagSet;