]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/jaeger-client-cpp/src/jaegertracing/metrics/NullStatsFactory.h
2 * Copyright (c) 2017 Uber Technologies, Inc.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef JAEGERTRACING_METRICS_NULLSTATSFACTORY_H
18 #define JAEGERTRACING_METRICS_NULLSTATSFACTORY_H
22 #include <unordered_map>
24 #include "jaegertracing/metrics/NullCounter.h"
25 #include "jaegertracing/metrics/NullGauge.h"
26 #include "jaegertracing/metrics/NullTimer.h"
27 #include "jaegertracing/metrics/StatsFactory.h"
29 namespace jaegertracing
{
36 class NullStatsFactory
: public StatsFactory
{
38 using StatsFactory::createCounter
;
39 using StatsFactory::createGauge
;
40 using StatsFactory::createTimer
;
42 std::unique_ptr
<Counter
>
43 createCounter(const std::string
&,
44 const std::unordered_map
<std::string
, std::string
>&) override
46 return std::unique_ptr
<Counter
>(new NullCounter());
49 std::unique_ptr
<Timer
>
50 createTimer(const std::string
&,
51 const std::unordered_map
<std::string
, std::string
>&) override
53 return std::unique_ptr
<Timer
>(new NullTimer());
56 std::unique_ptr
<Gauge
>
57 createGauge(const std::string
&,
58 const std::unordered_map
<std::string
, std::string
>&) override
60 return std::unique_ptr
<Gauge
>(new NullGauge());
64 } // namespace metrics
65 } // namespace jaegertracing
67 #endif // JAEGERTRACING_METRICS_NULLSTATSFACTORY_H