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  MountPoint* mount_point,
36  const std::string &fqrn);
38 
39  private:
40  std::map<std::string, int64_t> old_counters_;
41  std::string influx_host_;
43  std::string influx_metric_name_;
44  std::string influx_extra_fields_;
45  std::string influx_extra_tags_;
47  struct addrinfo *res_;
48 
49  std::string MakePayload();
50  std::string MakeDeltaPayload();
52  TelemetryReturn SendToInflux(const std::string &payload);
53 
54  virtual void PushMetrics();
55 };
56 
57 } // namespace perf
58 
59 #endif // CVMFS_TELEMETRY_AGGREGATOR_INFLUX_H_
TelemetryAggregatorInflux(Statistics *statistics, int send_rate_sec, OptionsManager *options_mgr, MountPoint *mount_point, const std::string &fqrn)
std::map< std::string, int64_t > old_counters_
TelemetryReturn SendToInflux(const std::string &payload)
FRIEND_TEST(T_TelemetryAggregator, EmptyCounters)