CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
telemetry_aggregator_influx.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_TELEMETRY_AGGREGATOR_INFLUX_H_
6 #define CVMFS_TELEMETRY_AGGREGATOR_INFLUX_H_
7 
8 #include <netdb.h>
9 #include <pthread.h>
10 #include <stdint.h>
11 
12 #include <cstring>
13 #include <map>
14 #include <string>
15 #include <vector>
16 
17 #include "gtest/gtest_prod.h"
18 #include "options.h"
19 #include "statistics.h"
20 #include "telemetry_aggregator.h"
21 #include "util/single_copy.h"
22 
23 namespace perf {
24 
26  FRIEND_TEST(T_TelemetryAggregator, EmptyCounters);
27  FRIEND_TEST(T_TelemetryAggregator, FailCreate);
28  FRIEND_TEST(T_TelemetryAggregator, ExtraFields_Tags);
29  FRIEND_TEST(T_TelemetryAggregator, UpdateCounters_WithExtraFields_Tags);
30 
31  public:
33  int send_rate_sec,
34  OptionsManager *options_mgr,
35  const std::string &fqrn);
37 
38  private:
39  std::map<std::string, int64_t> old_counters_;
40  std::string influx_host_;
42  std::string influx_metric_name_;
43  std::string influx_extra_fields_;
44  std::string influx_extra_tags_;
46  struct addrinfo *res_;
47 
48  std::string MakePayload();
49  std::string MakeDeltaPayload();
51  TelemetryReturn SendToInflux(const std::string &payload);
52 
53  virtual void PushMetrics();
54 };
55 
56 } // namespace perf
57 
58 #endif // CVMFS_TELEMETRY_AGGREGATOR_INFLUX_H_
std::map< std::string, int64_t > old_counters_
TelemetryReturn SendToInflux(const std::string &payload)
TelemetryAggregatorInflux(Statistics *statistics, int send_rate_sec, OptionsManager *options_mgr, const std::string &fqrn)
FRIEND_TEST(T_TelemetryAggregator, EmptyCounters)