18 #ifndef ION_ANALYTICS_BENCHMARK_H_
19 #define ION_ANALYTICS_BENCHMARK_H_
24 #include "base/integral_types.h"
40 const std::string& group_in,
41 const std::string& description_in,
42 const std::string& units_in)
45 description(description_in),
56 : descriptor(descriptor_in),
66 Sample(uint32 time_offset_ms_in,
double value_in)
67 : time_offset_ms(time_offset_ms_in),
77 : descriptor(descriptor_in) {}
86 double minimum_in,
double maximum_in,
87 double mean_in,
double standard_deviation_in)
88 : descriptor(descriptor_in),
93 standard_deviation(standard_deviation_in) {}
106 : variable_(descriptor) {}
109 void AddSample(
double value);
127 void AddSample(
double value);
141 sampled_variables_.push_back(variable);
144 accumulated_variables_.push_back(variable);
148 const std::vector<Constant>&
GetConstants()
const {
return constants_; }
150 return sampled_variables_;
153 return accumulated_variables_;
158 static const AccumulatedVariable AccumulateSampledVariable(
159 const SampledVariable& sampled_variable);
162 std::vector<Constant> constants_;
163 std::vector<SampledVariable> sampled_variables_;
164 std::vector<AccumulatedVariable> accumulated_variables_;
170 #endif // ION_ANALYTICS_BENCHMARK_H_
Sample(uint32 time_offset_ms_in, double value_in)
AccumulatedVariable(const Descriptor &descriptor_in, size_t samples_in, double minimum_in, double maximum_in, double mean_in, double standard_deviation_in)
void AddSampledVariable(const SampledVariable &variable)
SampledVariable(const Descriptor &descriptor_in)
const std::vector< Constant > & GetConstants() const
Each of these returns the results for a given type of measurement.
void AddAccumulatedVariable(const AccumulatedVariable &variable)
const std::vector< SampledVariable > & GetSampledVariables() const
This struct represents a single timestamped value of a variable.
Constant(const Descriptor &descriptor_in, double value_in)
This class aids in creation of a benchmarked SampledVariable.
This struct represents a number that is constant over all samples.
const std::vector< AccumulatedVariable > & GetAccumulatedVariables() const
const SampledVariable Get()
Returns the resulting SampledVariable.
VariableSampler(const Descriptor &descriptor)
void AddConstant(const Constant &constant)
Each of these adds a measurement of a specific type to the benchmark results.
This struct represents a variable: a number that may vary over samples, such as a count or timing...
This struct stores information about a measurement computed by benchmarking.
The Benchmark class provides types and utilities to make it easier to create performance benchmarks...
double standard_deviation
This class aids in accumulation of a benchmarked AccumulatedVariable.
std::vector< Sample > samples
This struct represents accumulated values for a variable.
Descriptor(const std::string &id_in, const std::string &group_in, const std::string &description_in, const std::string &units_in)