forked from jupp0r/prometheus-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.h
More file actions
31 lines (24 loc) · 754 Bytes
/
handler.h
File metadata and controls
31 lines (24 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <memory>
#include <vector>
#include "CivetServer.h"
#include "prometheus/registry.h"
namespace prometheus {
namespace detail {
class MetricsHandler : public CivetHandler {
public:
MetricsHandler(const std::vector<std::weak_ptr<Collectable>>& collectables,
Registry& registry);
bool handleGet(CivetServer* server, struct mg_connection* conn) override;
private:
std::vector<MetricFamily> CollectMetrics() const;
const std::vector<std::weak_ptr<Collectable>>& collectables_;
Family<Counter>& bytes_transferred_family_;
Counter& bytes_transferred_;
Family<Counter>& num_scrapes_family_;
Counter& num_scrapes_;
Family<Summary>& request_latencies_family_;
Summary& request_latencies_;
};
}
}