Chromium Code Reviews| Index: webrtc/pc/rtcstatscollector.cc |
| diff --git a/webrtc/pc/rtcstatscollector.cc b/webrtc/pc/rtcstatscollector.cc |
| index f5b8c8a936c1b569826ff20d98741e62ddb5e550..3bd5a13bcfca1db09a6ac061e29ff3dae447a974 100644 |
| --- a/webrtc/pc/rtcstatscollector.cc |
| +++ b/webrtc/pc/rtcstatscollector.cc |
| @@ -25,11 +25,17 @@ |
| #include "webrtc/pc/webrtcsession.h" |
| #include "webrtc/rtc_base/checks.h" |
| #include "webrtc/rtc_base/timeutils.h" |
| +#include "webrtc/rtc_base/trace_event.h" |
| namespace webrtc { |
| namespace { |
| +std::string TraceNameFromStatsTypeAndMemberName(const char* stats_type, |
| + const char* member_name) { |
| + return std::string(stats_type) + '.' + member_name; |
|
tommi
2017/07/12 15:34:20
'.' + member_name
by itself is the same as doing
ehmaldonado_webrtc
2017/07/12 15:40:32
Yes, I'm counting on that.
How would I make it mor
tommi
2017/07/12 15:44:52
Yes, that's one way.
Alternatively you could use
ehmaldonado_webrtc
2017/07/12 15:58:27
Ok, I see :)
Something it's not clear to me, Is i
hbos
2017/07/12 16:20:15
It would indeed not be valid to reference it once
ehmaldonado_webrtc
2017/07/12 16:36:07
Makes sense.
Done.
|
| +} |
| + |
| std::string RTCCertificateIDFromFingerprint(const std::string& fingerprint) { |
| return "RTCCertificate_" + fingerprint; |
| } |
| @@ -751,6 +757,17 @@ void RTCStatsCollector::AddPartialResults_s( |
| channel_name_pairs_.reset(); |
| track_media_info_map_.reset(); |
| track_to_id_.clear(); |
| + for (const RTCStats& stats : *cached_report_) { |
| + for (const RTCStatsMemberInterface* member : stats.Members()) { |
| + if (member->is_defined()) { |
| + TRACE_EVENT_INSTANT2("webrtc_stats", |
| + TraceNameFromStatsTypeAndMemberName( |
| + stats.type(), member->name()).c_str(), |
| + "value", member->ValueToString(), |
| + "id", stats.id()); |
| + } |
| + } |
| + } |
| DeliverCachedReport(); |
| } |
| } |