libstatistics_collector  master
Lightweight aggregation utilities to collect statistics and measure message metrics.
All Classes Functions Variables Pages
types.hpp
1 // Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef LIBSTATISTICS_COLLECTOR__MOVING_AVERAGE_STATISTICS__TYPES_HPP_
16 #define LIBSTATISTICS_COLLECTOR__MOVING_AVERAGE_STATISTICS__TYPES_HPP_
17 
18 #include <cmath>
19 #include <sstream>
20 #include <string>
21 
22 #include "libstatistics_collector/visibility_control.hpp"
23 
24 namespace libstatistics_collector
25 {
26 namespace moving_average_statistics
27 {
28 
32 struct LIBSTATISTICS_COLLECTOR_PUBLIC StatisticData
33 {
35  double average = std::nan("");
37  double min = std::nan("");
39  double max = std::nan("");
41  double standard_deviation = std::nan("");
43  uint64_t sample_count = 0;
44 };
45 
53 LIBSTATISTICS_COLLECTOR_PUBLIC
54 std::string StatisticsDataToString(const StatisticData & results);
55 
56 } // namespace moving_average_statistics
57 } // namespace libstatistics_collector
58 
59 #endif // LIBSTATISTICS_COLLECTOR__MOVING_AVERAGE_STATISTICS__TYPES_HPP_
libstatistics_collector::moving_average_statistics::StatisticData
Definition: types.hpp:32