Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Side by Side Diff: net/nqe/event_creator.h

Issue 2643213003: NQE: Add net log events when there is a significant change in metrics (Closed)
Patch Set: ryansturm comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/nqe/event_creator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_NQE_EVENT_CREATOR_H_ 5 #ifndef NET_NQE_EVENT_CREATOR_H_
6 #define NET_NQE_EVENT_CREATOR_H_ 6 #define NET_NQE_EVENT_CREATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h"
11 #include "base/threading/thread_checker.h"
10 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "net/base/net_export.h"
14 #include "net/log/net_log_with_source.h"
11 #include "net/nqe/effective_connection_type.h" 15 #include "net/nqe/effective_connection_type.h"
16 #include "net/nqe/network_quality.h"
12 17
13 namespace net { 18 namespace net {
14 19
15 class NetLogWithSource; 20 class NetLogWithSource;
16 21
17 namespace nqe { 22 namespace nqe {
18 23
19 namespace internal { 24 namespace internal {
20 25
21 // Adds network quality changed event to the net-internals log. |http_rtt| is 26 // Class that adds net log events for network quality estimator.
22 // the estimate of the HTTP RTT. |transport_rtt| is the estimate of the 27 class NET_EXPORT_PRIVATE EventCreator {
23 // transport RTT. |downstream_throughput_kbps| is the estimate of the 28 public:
24 // downstream throughput (in kilobits per second). |effective_connection_type| 29 explicit EventCreator(NetLogWithSource net_log);
25 // is the current estimate of the effective connection type. 30 ~EventCreator();
26 void AddEffectiveConnectionTypeChangedEventToNetLog( 31
27 const NetLogWithSource& net_log, 32 // May add network quality changed event to the net-internals log if there
28 base::TimeDelta http_rtt, 33 // is a change in the effective connection type, or if there is a change in
29 base::TimeDelta transport_rtt, 34 // the availability of HTTP RTT, transport RTT or bandwidth.
30 int32_t downstream_throughput_kbps, 35 // |effective_connection_type| is the current effective connection type.
31 EffectiveConnectionType effective_connection_type); 36 // |network_quality| is the current network quality.
37 void MaybeAddEffectiveConnectionTypeChangedEventToNetLog(
38 EffectiveConnectionType effective_connection_type,
39 const NetworkQuality& network_quality);
40
41 private:
42 NetLogWithSource net_log_;
43
44 // The effective connection type when the net log event was last added.
45 EffectiveConnectionType past_effective_connection_type_;
46
47 // The network quality when the net log event was last added.
48 NetworkQuality past_network_quality_;
49
50 base::ThreadChecker thread_checker_;
51
52 DISALLOW_COPY_AND_ASSIGN(EventCreator);
53 };
32 54
33 } // namespace internal 55 } // namespace internal
34 56
35 } // namespace nqe 57 } // namespace nqe
36 58
37 } // namespace net 59 } // namespace net
38 60
39 #endif // NET_NQE_EVENT_CREATOR_H_ 61 #endif // NET_NQE_EVENT_CREATOR_H_
OLDNEW
« no previous file with comments | « no previous file | net/nqe/event_creator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698