1*58b9f456SAndroid Build Coastguard Worker // Copyright 2016 Ismael Jimenez Martinez. All rights reserved. 2*58b9f456SAndroid Build Coastguard Worker // Copyright 2017 Roman Lebedev. All rights reserved. 3*58b9f456SAndroid Build Coastguard Worker // 4*58b9f456SAndroid Build Coastguard Worker // Licensed under the Apache License, Version 2.0 (the "License"); 5*58b9f456SAndroid Build Coastguard Worker // you may not use this file except in compliance with the License. 6*58b9f456SAndroid Build Coastguard Worker // You may obtain a copy of the License at 7*58b9f456SAndroid Build Coastguard Worker // 8*58b9f456SAndroid Build Coastguard Worker // http://www.apache.org/licenses/LICENSE-2.0 9*58b9f456SAndroid Build Coastguard Worker // 10*58b9f456SAndroid Build Coastguard Worker // Unless required by applicable law or agreed to in writing, software 11*58b9f456SAndroid Build Coastguard Worker // distributed under the License is distributed on an "AS IS" BASIS, 12*58b9f456SAndroid Build Coastguard Worker // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*58b9f456SAndroid Build Coastguard Worker // See the License for the specific language governing permissions and 14*58b9f456SAndroid Build Coastguard Worker // limitations under the License. 15*58b9f456SAndroid Build Coastguard Worker 16*58b9f456SAndroid Build Coastguard Worker #ifndef STATISTICS_H_ 17*58b9f456SAndroid Build Coastguard Worker #define STATISTICS_H_ 18*58b9f456SAndroid Build Coastguard Worker 19*58b9f456SAndroid Build Coastguard Worker #include <vector> 20*58b9f456SAndroid Build Coastguard Worker 21*58b9f456SAndroid Build Coastguard Worker #include "benchmark/benchmark.h" 22*58b9f456SAndroid Build Coastguard Worker 23*58b9f456SAndroid Build Coastguard Worker namespace benchmark { 24*58b9f456SAndroid Build Coastguard Worker 25*58b9f456SAndroid Build Coastguard Worker // Return a vector containing the mean, median and standard devation information 26*58b9f456SAndroid Build Coastguard Worker // (and any user-specified info) for the specified list of reports. If 'reports' 27*58b9f456SAndroid Build Coastguard Worker // contains less than two non-errored runs an empty vector is returned 28*58b9f456SAndroid Build Coastguard Worker std::vector<BenchmarkReporter::Run> ComputeStats( 29*58b9f456SAndroid Build Coastguard Worker const std::vector<BenchmarkReporter::Run>& reports); 30*58b9f456SAndroid Build Coastguard Worker 31*58b9f456SAndroid Build Coastguard Worker double StatisticsMean(const std::vector<double>& v); 32*58b9f456SAndroid Build Coastguard Worker double StatisticsMedian(const std::vector<double>& v); 33*58b9f456SAndroid Build Coastguard Worker double StatisticsStdDev(const std::vector<double>& v); 34*58b9f456SAndroid Build Coastguard Worker 35*58b9f456SAndroid Build Coastguard Worker } // end namespace benchmark 36*58b9f456SAndroid Build Coastguard Worker 37*58b9f456SAndroid Build Coastguard Worker #endif // STATISTICS_H_ 38