aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Samain <jsamain+fdio@cisco.com>2017-07-07 14:32:29 +0200
committerJacques Samain <jsamain+fdio@cisco.com>2017-07-07 14:32:29 +0200
commit98a3c9497b4bebbc18092b468ea5929afde65b81 (patch)
treee623065b88d75a20f1977006a1b59a318f6e0d22
parent2612f3320e3d1a601beb9b2b008fb475dccd1c39 (diff)
Reinstating notification of downloading time
Change-Id: I07a5e3d42b558d743ba6cae9ab2bd942f21f4e91 Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
-rw-r--r--icnet/transport/icnet_transport_download_observer.h2
-rw-r--r--icnet/transport/icnet_transport_rate_estimation.cc7
2 files changed, 5 insertions, 4 deletions
diff --git a/icnet/transport/icnet_transport_download_observer.h b/icnet/transport/icnet_transport_download_observer.h
index f53f3706..4902f2d7 100644
--- a/icnet/transport/icnet_transport_download_observer.h
+++ b/icnet/transport/icnet_transport_download_observer.h
@@ -26,7 +26,7 @@ class IcnObserver {
};
virtual void notifyStats(double throughput) = 0;
- //virtual void notifyDownloadTime(double downloadTime) = 0;
+ virtual void notifyDownloadTime(double downloadTime) = 0;
};
} // end namespace transport
diff --git a/icnet/transport/icnet_transport_rate_estimation.cc b/icnet/transport/icnet_transport_rate_estimation.cc
index 4c2d68c3..c9b34fdb 100644
--- a/icnet/transport/icnet_transport_rate_estimation.cc
+++ b/icnet/transport/icnet_transport_rate_estimation.cc
@@ -198,9 +198,9 @@ void SimpleEstimator::onDownloadFinished() {
gettimeofday(&end, 0);
double delay = RaaqmDataPath::getMicroSeconds(end) - RaaqmDataPath::getMicroSeconds(this->start_time_);
- //if(observer_) {
- // observer_->notifyDownloadTime(delay);
- //}
+ if(observer_) {
+ observer_->notifyDownloadTime(delay);
+ }
if (!this->estimated_) {
//Assuming all packets carry max_packet_size_ bytes of data (8*max_packet_size_ bits); 1000000 factor to convert us to seconds
if (this->estimation_) {
@@ -213,6 +213,7 @@ void SimpleEstimator::onDownloadFinished() {
}
this->alpha_ = this->base_alpha_ * (((double) this->number_of_packets_) / ((double) this->batching_param_));
} else {
+ delay = RaaqmDataPath::getMicroSeconds(end) - RaaqmDataPath::getMicroSeconds(this->begin_batch_);
if (this->number_of_packets_ >= (int) (75.0 * (double) this->batching_param_ / 100.0)) {
//Assuming all packets carry max_packet_size_ bytes of data (8*max_packet_size_ bits); 1000000 factor to convert us to seconds
if (this->estimation_) {