summaryrefslogtreecommitdiffstats
path: root/net/base/network_quality.h
blob: 4e2985776e0f4a8430b80c7523751391b4b0c0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_BASE_NETWORK_QUALITY_H_
#define NET_BASE_NETWORK_QUALITY_H_

#include <stdint.h>

#include "base/time/time.h"

namespace net {

// API that is used to report the current network quality as estimated by the
// NetworkQualityEstimator.
struct NET_EXPORT_PRIVATE NetworkQuality {
  NetworkQuality(const base::TimeDelta& fastest_rtt,
                 double fastest_rtt_confidence,
                 uint64_t peak_throughput_kbps,
                 double peak_throughput_kbps_confidence)
      : fastest_rtt(fastest_rtt),
        fastest_rtt_confidence(fastest_rtt_confidence),
        peak_throughput_kbps(peak_throughput_kbps),
        peak_throughput_kbps_confidence(peak_throughput_kbps_confidence) {}

  ~NetworkQuality() {}

  // The fastest round trip time observed for the current connection.
  const base::TimeDelta fastest_rtt;

  // Confidence of the |fastest_rtt| estimate. Value lies between 0.0 and 1.0
  // with 0.0 being no confidence and 1.0 implying that estimates are same as
  // ground truth.
  // TODO(tbansal): Define units so values intermediate between 0.0 and 1.0 are
  // meaningful.
  const double fastest_rtt_confidence;

  // Peak throughput in Kbps observed for the current connection.
  const uint64_t peak_throughput_kbps;

  // Confidence of the |peak_throughput_kbps| estimate. Value lies between 0.0
  // and 1.0 with 0.0 being no confidence and 1.0 implying that estimates are
  // same as ground truth.
  // TODO(tbansal): Define units so values intermediate between 0.0 and 1.0 are
  // meaningful.
  const double peak_throughput_kbps_confidence;
};

}  // namespace net

#endif  // NET_BASE_NETWORK_QUALITY_H_