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

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

Issue 2654033010: NQE: Record the number of RTT and throughput samples received (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_NETWORK_QUALITY_ESTIMATOR_H_ 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // and |downstream_throughput_kbps| are set to the expected HTTP RTT, 373 // and |downstream_throughput_kbps| are set to the expected HTTP RTT,
374 // transport RTT and downstream throughput (in kilobits per second) based on 374 // transport RTT and downstream throughput (in kilobits per second) based on
375 // observations taken since |start_time|. Virtualized for testing. 375 // observations taken since |start_time|. Virtualized for testing.
376 virtual EffectiveConnectionType 376 virtual EffectiveConnectionType
377 GetRecentEffectiveConnectionTypeAndNetworkQuality( 377 GetRecentEffectiveConnectionTypeAndNetworkQuality(
378 const base::TimeTicks& start_time, 378 const base::TimeTicks& start_time,
379 base::TimeDelta* http_rtt, 379 base::TimeDelta* http_rtt,
380 base::TimeDelta* transport_rtt, 380 base::TimeDelta* transport_rtt,
381 int32_t* downstream_throughput_kbps) const; 381 int32_t* downstream_throughput_kbps) const;
382 382
383 // Notifies |this| of a new transport layer RTT. Called by socket watchers.
384 // Protected for testing.
385 void OnUpdatedRTTAvailable(SocketPerformanceWatcherFactory::Protocol protocol,
386 const base::TimeDelta& rtt);
387
383 private: 388 private:
384 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, 389 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
385 AdaptiveRecomputationEffectiveConnectionType); 390 AdaptiveRecomputationEffectiveConnectionType);
386 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, StoreObservations); 391 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, StoreObservations);
387 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestAddObservation); 392 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, TestAddObservation);
388 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, 393 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
389 DefaultObservationsOverridden); 394 DefaultObservationsOverridden);
390 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, 395 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest,
391 ObtainAlgorithmToUseFromParams); 396 ObtainAlgorithmToUseFromParams);
392 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, HalfLifeParam); 397 FRIEND_TEST_ALL_PREFIXES(NetworkQualityEstimatorTest, HalfLifeParam);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 void RecordNetworkIDAvailability() const; 463 void RecordNetworkIDAvailability() const;
459 464
460 // Records UMA on main frame requests. 465 // Records UMA on main frame requests.
461 void RecordMetricsOnMainFrameRequest() const; 466 void RecordMetricsOnMainFrameRequest() const;
462 467
463 // Records a downstream throughput observation to the observation buffer if 468 // Records a downstream throughput observation to the observation buffer if
464 // a valid observation is available. |downstream_kbps| is the downstream 469 // a valid observation is available. |downstream_kbps| is the downstream
465 // throughput in kilobits per second. 470 // throughput in kilobits per second.
466 void OnNewThroughputObservationAvailable(int32_t downstream_kbps); 471 void OnNewThroughputObservationAvailable(int32_t downstream_kbps);
467 472
468 // Notifies |this| of a new transport layer RTT.
469 void OnUpdatedRTTAvailable(SocketPerformanceWatcherFactory::Protocol protocol,
470 const base::TimeDelta& rtt);
471
472 // Obtains the model parameters for different effective connection types from 473 // Obtains the model parameters for different effective connection types from
473 // the field trial parameters. For each effective connection type, a model 474 // the field trial parameters. For each effective connection type, a model
474 // (currently composed of a RTT threshold and a downlink throughput threshold) 475 // (currently composed of a RTT threshold and a downlink throughput threshold)
475 // is provided by the field trial. 476 // is provided by the field trial.
476 void ObtainOperatingParams( 477 void ObtainOperatingParams(
477 const std::map<std::string, std::string>& variation_params); 478 const std::map<std::string, std::string>& variation_params);
478 479
479 // Adds the default median RTT and downstream throughput estimate for the 480 // Adds the default median RTT and downstream throughput estimate for the
480 // current connection type to the observation buffer. 481 // current connection type to the observation buffer.
481 void AddDefaultEstimates(); 482 void AddDefaultEstimates();
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 nqe::internal::EventCreator event_creator_; 768 nqe::internal::EventCreator event_creator_;
768 769
769 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 770 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
770 771
771 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 772 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
772 }; 773 };
773 774
774 } // namespace net 775 } // namespace net
775 776
776 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 777 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW
« no previous file with comments | « no previous file | net/nqe/network_quality_estimator.cc » ('j') | net/nqe/network_quality_estimator_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698