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

Side by Side Diff: webrtc/api/statscollector.cc

Issue 1940493002: Add Stats to Stun ping. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/statstypes.h » ('j') | webrtc/api/statstypes.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 for (const auto& b : bools) 604 for (const auto& b : bools)
605 report->AddBoolean(b.name, b.value); 605 report->AddBoolean(b.name, b.value);
606 606
607 report->AddId(StatsReport::kStatsValueNameChannelId, channel_report_id); 607 report->AddId(StatsReport::kStatsValueNameChannelId, channel_report_id);
608 report->AddId(StatsReport::kStatsValueNameLocalCandidateId, 608 report->AddId(StatsReport::kStatsValueNameLocalCandidateId,
609 AddCandidateReport(info.local_candidate, true)->id()); 609 AddCandidateReport(info.local_candidate, true)->id());
610 report->AddId(StatsReport::kStatsValueNameRemoteCandidateId, 610 report->AddId(StatsReport::kStatsValueNameRemoteCandidateId,
611 AddCandidateReport(info.remote_candidate, false)->id()); 611 AddCandidateReport(info.remote_candidate, false)->id());
612 612
613 const Int64ForAdd int64s[] = { 613 const Int64ForAdd int64s[] = {
614 { StatsReport::kStatsValueNameBytesReceived, info.recv_total_bytes }, 614 {StatsReport::kStatsValueNameBytesReceived, info.recv_total_bytes},
615 { StatsReport::kStatsValueNameBytesSent, info.sent_total_bytes }, 615 {StatsReport::kStatsValueNameBytesSent, info.sent_total_bytes},
616 { StatsReport::kStatsValueNamePacketsSent, info.sent_total_packets }, 616 {StatsReport::kStatsValueNamePacketsSent, info.sent_total_packets},
617 { StatsReport::kStatsValueNameRtt, info.rtt }, 617 {StatsReport::kStatsValueNameRtt, info.rtt},
618 { StatsReport::kStatsValueNameSendPacketsDiscarded, 618 {StatsReport::kStatsValueNameSendPacketsDiscarded,
619 info.sent_discarded_packets }, 619 info.sent_discarded_packets},
620 {StatsReport::kStatsValueNameSentPingRequests, info.sent_ping_requests},
621 {StatsReport::kStatsValueNameRecvPingResponses, info.recv_ping_responses},
620 }; 622 };
621 for (const auto& i : int64s) 623 for (const auto& i : int64s)
622 report->AddInt64(i.name, i.value); 624 report->AddInt64(i.name, i.value);
623 625
624 report->AddString(StatsReport::kStatsValueNameLocalAddress, 626 report->AddString(StatsReport::kStatsValueNameLocalAddress,
625 info.local_candidate.address().ToString()); 627 info.local_candidate.address().ToString());
626 report->AddString(StatsReport::kStatsValueNameLocalCandidateType, 628 report->AddString(StatsReport::kStatsValueNameLocalCandidateType,
627 info.local_candidate.type()); 629 info.local_candidate.type());
628 report->AddString(StatsReport::kStatsValueNameRemoteAddress, 630 report->AddString(StatsReport::kStatsValueNameRemoteAddress,
629 info.remote_candidate.address().ToString()); 631 info.remote_candidate.address().ToString());
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 StatsReport* report = entry.second; 974 StatsReport* report = entry.second;
973 report->set_timestamp(stats_gathering_started_); 975 report->set_timestamp(stats_gathering_started_);
974 } 976 }
975 } 977 }
976 978
977 void StatsCollector::ClearUpdateStatsCacheForTest() { 979 void StatsCollector::ClearUpdateStatsCacheForTest() {
978 stats_gathering_started_ = 0; 980 stats_gathering_started_ = 0;
979 } 981 }
980 982
981 } // namespace webrtc 983 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/statstypes.h » ('j') | webrtc/api/statstypes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698