Add AEC filter divergence metric to StatsCollector.

A new metric that tells how often the AEC linear filter diverges has been recently introduced, see
https://codereview.webrtc.org/1739993003/

This metric can reflect echo failure and ducking.

In this CL, we add a field in StatsCollector to receive this metric.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1866983002 .

Cr-Commit-Position: refs/heads/master@{#12282}
diff --git a/webrtc/api/mediastreaminterface.h b/webrtc/api/mediastreaminterface.h
index 2a3f347..57c0776 100644
--- a/webrtc/api/mediastreaminterface.h
+++ b/webrtc/api/mediastreaminterface.h
@@ -215,7 +215,8 @@
                             echo_return_loss_enhancement(0),
                             echo_delay_median_ms(0),
                             aec_quality_min(0.0),
-                            echo_delay_std_ms(0) {}
+                            echo_delay_std_ms(0),
+                            aec_divergent_filter_fraction(0.0) {}
     ~AudioProcessorStats() {}
 
     bool typing_noise_detected;
@@ -224,6 +225,7 @@
     int echo_delay_median_ms;
     float aec_quality_min;
     int echo_delay_std_ms;
+    float aec_divergent_filter_fraction;
   };
 
   // Get audio processor statistics.
diff --git a/webrtc/api/statscollector.cc b/webrtc/api/statscollector.cc
index 0901fc6..38fb5fb 100644
--- a/webrtc/api/statscollector.cc
+++ b/webrtc/api/statscollector.cc
@@ -937,6 +937,9 @@
         report, stats.typing_noise_detected, stats.echo_return_loss,
         stats.echo_return_loss_enhancement, stats.echo_delay_median_ms,
         stats.aec_quality_min, stats.echo_delay_std_ms);
+
+    report->AddFloat(StatsReport::kStatsValueNameAecDivergentFilterFraction,
+                     stats.aec_divergent_filter_fraction);
   }
 }
 
diff --git a/webrtc/api/statstypes.cc b/webrtc/api/statstypes.cc
index feeead4..61af824 100644
--- a/webrtc/api/statstypes.cc
+++ b/webrtc/api/statstypes.cc
@@ -363,6 +363,8 @@
 
 const char* StatsReport::Value::display_name() const {
   switch (name) {
+    case kStatsValueNameAecDivergentFilterFraction:
+      return "aecDivergentFilterFraction";
     case kStatsValueNameAudioOutputLevel:
       return "audioOutputLevel";
     case kStatsValueNameAudioInputLevel:
diff --git a/webrtc/api/statstypes.h b/webrtc/api/statstypes.h
index 9a44724..7efd0fe 100644
--- a/webrtc/api/statstypes.h
+++ b/webrtc/api/statstypes.h
@@ -99,6 +99,7 @@
 
   enum StatsValueName {
     kStatsValueNameActiveConnection,
+    kStatsValueNameAecDivergentFilterFraction,
     kStatsValueNameAudioInputLevel,
     kStatsValueNameAudioOutputLevel,
     kStatsValueNameBytesReceived,