| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_NQE_NETWORK_QUALITY_OBSERVATION_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_OBSERVATION_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/gtest_prod_util.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" |
| 13 #include "net/base/net_export.h" |
| 14 #include "net/nqe/network_quality_observation_source.h" |
| 15 |
| 16 namespace net { |
| 17 |
| 18 namespace nqe { |
| 19 |
| 20 namespace internal { |
| 21 |
| 22 // Records observations of network quality metrics (such as round trip time |
| 23 // or throughput), along with the time the observation was made. Observations |
| 24 // can be made at several places in the network stack, thus the observation |
| 25 // source is provided as well. ValueType must be numerical so that statistics |
| 26 // such as median, average can be computed. |
| 27 template <typename ValueType> |
| 28 struct NET_EXPORT_PRIVATE Observation { |
| 29 Observation(const ValueType& value, |
| 30 base::TimeTicks timestamp, |
| 31 NetworkQualityObservationSource source) |
| 32 : value(value), timestamp(timestamp), source(source) { |
| 33 DCHECK(!timestamp.is_null()); |
| 34 } |
| 35 ~Observation() {} |
| 36 |
| 37 // Value of the observation. |
| 38 const ValueType value; |
| 39 |
| 40 // Time when the observation was taken. |
| 41 const base::TimeTicks timestamp; |
| 42 |
| 43 // The source of the observation. |
| 44 const NetworkQualityObservationSource source; |
| 45 }; |
| 46 |
| 47 } // namespace internal |
| 48 |
| 49 } // namespace nqe |
| 50 |
| 51 } // namespace net |
| 52 |
| 53 #endif // NET_NQE_NETWORK_QUALITY_OBSERVATION_H_ |
| OLD | NEW |