|
|
@ -36,11 +36,14 @@ namespace tunnel |
|
|
|
TunnelLatency::Latency TunnelLatency::GetMeanLatency() const |
|
|
|
TunnelLatency::Latency TunnelLatency::GetMeanLatency() const |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::unique_lock<std::mutex> lock(m_access); |
|
|
|
std::unique_lock<std::mutex> lock(m_access); |
|
|
|
|
|
|
|
if (m_samples.size() > 0) { |
|
|
|
Latency l = 0; |
|
|
|
Latency l = 0; |
|
|
|
for(auto s : m_samples) |
|
|
|
for(auto s : m_samples) |
|
|
|
l += s; |
|
|
|
l += s; |
|
|
|
return l / m_samples.size(); |
|
|
|
return l / m_samples.size(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tunnel::Tunnel (std::shared_ptr<const TunnelConfig> config): |
|
|
|
Tunnel::Tunnel (std::shared_ptr<const TunnelConfig> config): |
|
|
|