metrics/family_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 The Cartographer Authors
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 CARTOGRAPHER_METRICS_FAMILY_FACTORY_H_
18 #define CARTOGRAPHER_METRICS_FAMILY_FACTORY_H_
19 
20 #include <memory>
21 #include <string>
22 
26 
27 namespace cartographer {
28 namespace metrics {
29 
30 template <typename MetricType>
31 class Family {
32  public:
33  virtual ~Family() = default;
34 
35  virtual MetricType* Add(const std::map<std::string, std::string>& labels) = 0;
36 };
37 
39  public:
40  virtual ~FamilyFactory() = default;
41 
42  virtual Family<Counter>* NewCounterFamily(const std::string& name,
43  const std::string& description) = 0;
44  virtual Family<Gauge>* NewGaugeFamily(const std::string& name,
45  const std::string& description) = 0;
46  virtual Family<Histogram>* NewHistogramFamily(
47  const std::string& name, const std::string& description,
48  const Histogram::BucketBoundaries& boundaries) = 0;
49 };
50 
51 } // namespace metrics
52 } // namespace cartographer
53 
54 #endif // CARTOGRAPHER_METRICS_FAMILY_FACTORY_H_
std::vector< double > BucketBoundaries
virtual MetricType * Add(const std::map< std::string, std::string > &labels)=0


cartographer
Author(s): The Cartographer Authors
autogenerated on Mon Feb 28 2022 22:00:58