From 8abcf83b4ff3a161fec4d65e45b62a03fc33d4f2 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Tue, 21 May 2019 10:13:06 +0200 Subject: [PATCH] Adds IsEmpty to SampleStats. Bug: webrtc:9883 Change-Id: Ie8ef801cb60fd74c0354ff9fbbdbc33b7d105317 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137514 Reviewed-by: Rasmus Brandt Commit-Queue: Rasmus Brandt Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#28003} --- test/scenario/performance_stats.cc | 8 ++++++++ test/scenario/performance_stats.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/test/scenario/performance_stats.cc b/test/scenario/performance_stats.cc index 3471cbe0e1..0b2ae9fd21 100644 --- a/test/scenario/performance_stats.cc +++ b/test/scenario/performance_stats.cc @@ -90,6 +90,10 @@ void SampleStats::AddSamples(const SampleStats& other) { stats_.AddSamples(other.stats_); } +bool SampleStats::IsEmpty() { + return stats_.IsEmpty(); +} + TimeDelta SampleStats::Max() { return TimeDelta::seconds(stats_.Max()); } @@ -130,6 +134,10 @@ void SampleStats::AddSamples(const SampleStats& other) { stats_.AddSamples(other.stats_); } +bool SampleStats::IsEmpty() { + return stats_.IsEmpty(); +} + DataRate SampleStats::Max() { return DataRate::bps(stats_.Max()); } diff --git a/test/scenario/performance_stats.h b/test/scenario/performance_stats.h index 429d60f256..5a17654bc2 100644 --- a/test/scenario/performance_stats.h +++ b/test/scenario/performance_stats.h @@ -56,6 +56,7 @@ class SampleStats { void AddSample(TimeDelta delta); void AddSampleMs(double delta_ms); void AddSamples(const SampleStats& other); + bool IsEmpty(); TimeDelta Max(); TimeDelta Mean(); TimeDelta Median(); @@ -74,6 +75,7 @@ class SampleStats { void AddSample(DataRate rate); void AddSampleBps(double rate_bps); void AddSamples(const SampleStats& other); + bool IsEmpty(); DataRate Max(); DataRate Mean(); DataRate Median();