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

Unified Diff: webrtc/modules/audio_coding/neteq/statistics_calculator.h

Issue 1292423003: NetEq: Implement counting of Delayed Packet Outage Events per minute (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@neteq-metrics
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/statistics_calculator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/statistics_calculator.h
diff --git a/webrtc/modules/audio_coding/neteq/statistics_calculator.h b/webrtc/modules/audio_coding/neteq/statistics_calculator.h
index 513322f882525c712d073c871181a56822778cfb..c27aabe1281b757926df125dbc4abf85c86907ee 100644
--- a/webrtc/modules/audio_coding/neteq/statistics_calculator.h
+++ b/webrtc/modules/audio_coding/neteq/statistics_calculator.h
@@ -64,7 +64,8 @@ class StatisticsCalculator {
void LostSamples(int num_samples);
// Increases the report interval counter with |num_samples| at a sample rate
- // of |fs_hz|.
+ // of |fs_hz|. This is how the StatisticsCalculator gets notified that current
+ // time is increasing.
void IncreaseCounter(int num_samples, int fs_hz);
// Stores new packet waiting time in waiting time statistics.
@@ -95,6 +96,23 @@ class StatisticsCalculator {
static const int kMaxReportPeriod = 60; // Seconds before auto-reset.
static const int kLenWaitingTimes = 100;
+ class DelayedPacketOutagesPerMinuteCounter {
+ public:
+ ~DelayedPacketOutagesPerMinuteCounter() {
+ LogToUma(); // Log the count for the current (incomplete) interval.
+ }
+ void RegisterEvent();
+ void AdvanceClock(int step_ms);
+
+ private:
+ static const int kReportIntervalMs = 60 * 1000; // One minute.
+
+ void LogToUma() const;
+
+ int counter_ = 0;
+ int timer_ = 0;
+ };
+
// Calculates numerator / denominator, and returns the value in Q14.
static uint16_t CalculateQ14Ratio(uint32_t numerator, uint32_t denominator);
@@ -110,6 +128,7 @@ class StatisticsCalculator {
int len_waiting_times_;
int next_waiting_time_index_;
uint32_t secondary_decoded_samples_;
+ DelayedPacketOutagesPerMinuteCounter delayed_packet_outage_counter_;
DISALLOW_COPY_AND_ASSIGN(StatisticsCalculator);
};
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/statistics_calculator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698