]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | /* |
2 | * Copyright (c) 2017 Uber Technologies, Inc. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | #ifndef JAEGERTRACING_METRICS_STATSFACTORYIMPL_H | |
18 | #define JAEGERTRACING_METRICS_STATSFACTORYIMPL_H | |
19 | ||
20 | #include <memory> | |
21 | #include <string> | |
22 | #include <unordered_map> | |
23 | ||
24 | #include "jaegertracing/metrics/StatsFactory.h" | |
25 | #include "jaegertracing/metrics/StatsReporter.h" | |
26 | ||
27 | namespace jaegertracing { | |
28 | namespace metrics { | |
29 | ||
30 | class Counter; | |
31 | class Gauge; | |
32 | class Timer; | |
33 | ||
34 | class StatsFactoryImpl : public StatsFactory { | |
35 | public: | |
36 | using StatsFactory::createCounter; | |
37 | using StatsFactory::createGauge; | |
38 | using StatsFactory::createTimer; | |
39 | ||
40 | explicit StatsFactoryImpl(StatsReporter& reporter); | |
41 | ||
42 | ~StatsFactoryImpl() = default; | |
43 | ||
44 | std::unique_ptr<Counter> createCounter( | |
45 | const std::string& name, | |
46 | const std::unordered_map<std::string, std::string>& tags) override; | |
47 | ||
48 | std::unique_ptr<Timer> createTimer( | |
49 | const std::string& name, | |
50 | const std::unordered_map<std::string, std::string>& tags) override; | |
51 | ||
52 | std::unique_ptr<Gauge> createGauge( | |
53 | const std::string& name, | |
54 | const std::unordered_map<std::string, std::string>& tags) override; | |
55 | ||
56 | private: | |
57 | StatsReporter& _reporter; | |
58 | }; | |
59 | ||
60 | } // namespace metrics | |
61 | } // namespace jaegertracing | |
62 | ||
63 | #endif // JAEGERTRACING_METRICS_STATSFACTORYIMPL_H |