metrics/histogram.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_HISTOGRAM_H_
18 #define CARTOGRAPHER_METRICS_HISTOGRAM_H_
19 
20 #include <map>
21 #include <vector>
22 
23 namespace cartographer {
24 namespace metrics {
25 
26 class Histogram {
27  public:
28  using BucketBoundaries = std::vector<double>;
29 
30  // Histogram instance that does nothing. Safe for use in static initializers.
31  static Histogram* Null();
32 
33  static BucketBoundaries FixedWidth(double width, int num_finite_buckets);
34  static BucketBoundaries ScaledPowersOf(double base, double scale_factor,
35  double max_value);
36 
37  virtual ~Histogram() = default;
38  virtual void Observe(double value) = 0;
39 };
40 
41 } // namespace metrics
42 } // namespace cartographer
43 
44 #endif // CARTOGRAPHER_METRICS_HISTOGRAM_H_
virtual void Observe(double value)=0
static BucketBoundaries FixedWidth(double width, int num_finite_buckets)
std::vector< double > BucketBoundaries
static BucketBoundaries ScaledPowersOf(double base, double scale_factor, double max_value)


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