From 0ee442256c473e839d13af2bacc592f170157348 Mon Sep 17 00:00:00 2001 From: Jonas Oreland Date: Thu, 2 Dec 2021 10:48:45 +0100 Subject: [PATCH] Add reporting of relay protocol This patch adds reporting of relay protocol, i.e how a client connect to the turn server. This is added in the old stats api...cause there are clients still using it. Bug: none Change-Id: Iac7fe3e3de0ba42d5897c304ebbae368edf498fe Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239640 Reviewed-by: Harald Alvestrand Commit-Queue: Jonas Oreland Cr-Commit-Position: refs/heads/main@{#35469} --- api/stats_types.cc | 2 ++ api/stats_types.h | 1 + pc/stats_collector.cc | 2 ++ 3 files changed, 5 insertions(+) diff --git a/api/stats_types.cc b/api/stats_types.cc index 60818ee439..1090643f1c 100644 --- a/api/stats_types.cc +++ b/api/stats_types.cc @@ -654,6 +654,8 @@ const char* StatsReport::Value::display_name() const { return "googWritable"; case kStatsValueNameAudioDeviceUnderrunCounter: return "googAudioDeviceUnderrunCounter"; + case kStatsValueNameLocalCandidateRelayProtocol: + return "googLocalCandidateRelayProtocol"; } return nullptr; diff --git a/api/stats_types.h b/api/stats_types.h index 9a03db3e40..b7cb8eff7d 100644 --- a/api/stats_types.h +++ b/api/stats_types.h @@ -239,6 +239,7 @@ class RTC_EXPORT StatsReport { kStatsValueNameTypingNoiseState, kStatsValueNameWritable, kStatsValueNameAudioDeviceUnderrunCounter, + kStatsValueNameLocalCandidateRelayProtocol, }; class RTC_EXPORT IdBase : public rtc::RefCountInterface { diff --git a/pc/stats_collector.cc b/pc/stats_collector.cc index f4b48f71ad..dc172599da 100644 --- a/pc/stats_collector.cc +++ b/pc/stats_collector.cc @@ -808,6 +808,8 @@ StatsReport* StatsCollector::AddConnectionInfoReport( info.remote_candidate.type()); report->AddString(StatsReport::kStatsValueNameTransportType, info.local_candidate.protocol()); + report->AddString(StatsReport::kStatsValueNameLocalCandidateRelayProtocol, + info.local_candidate.relay_protocol()); return report; }