12f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org/*
22f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
32f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *
42f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *  Use of this source code is governed by a BSD-style license
52f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *  that can be found in the LICENSE file in the root of the source
62f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *  tree. An additional intellectual property rights grant can be found
72f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *  in the file PATENTS.  All contributing project authors may
82f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
92f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org */
102f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org#ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_STATISTICS_H_
112f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org#define WEBRTC_VIDEO_ENGINE_TEST_COMMON_STATISTICS_H_
122f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
132f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org#include "webrtc/typedefs.h"
142f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
152f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.orgnamespace webrtc {
162f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.orgnamespace test {
172f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
182f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.orgclass Statistics {
192f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org public:
202f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  Statistics();
212f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
222f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  void AddSample(double sample);
232f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
242f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  double Mean() const;
252f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  double Variance() const;
262f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  double StandardDeviation() const;
272f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
282f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org private:
292f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  double sum_;
302f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  double sum_squared_;
312f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org  uint64_t count_;
322f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org};
332f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org}  // namespace test
342f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org}  // namespace webrtc
352f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org
362f02da89501237cefea455cf31a1553125f62ad7pbos@webrtc.org#endif  // WEBRTC_VIDEO_ENGINE_TEST_COMMON_STATISTICS_H_
37