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

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: Rename. Created 4 years, 6 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') | no next file with comments »
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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 for (const auto& b : bools) 622 for (const auto& b : bools)
623 report->AddBoolean(b.name, b.value); 623 report->AddBoolean(b.name, b.value);
624 624
625 report->AddId(StatsReport::kStatsValueNameChannelId, channel_report_id); 625 report->AddId(StatsReport::kStatsValueNameChannelId, channel_report_id);
626 report->AddId(StatsReport::kStatsValueNameLocalCandidateId, 626 report->AddId(StatsReport::kStatsValueNameLocalCandidateId,
627 AddCandidateReport(info.local_candidate, true)->id()); 627 AddCandidateReport(info.local_candidate, true)->id());
628 report->AddId(StatsReport::kStatsValueNameRemoteCandidateId, 628 report->AddId(StatsReport::kStatsValueNameRemoteCandidateId,
629 AddCandidateReport(info.remote_candidate, false)->id()); 629 AddCandidateReport(info.remote_candidate, false)->id());
630 630
631 const Int64ForAdd int64s[] = { 631 const Int64ForAdd int64s[] = {
632 { StatsReport::kStatsValueNameBytesReceived, info.recv_total_bytes }, 632 {StatsReport::kStatsValueNameBytesReceived, info.recv_total_bytes},
633 { StatsReport::kStatsValueNameBytesSent, info.sent_total_bytes }, 633 {StatsReport::kStatsValueNameBytesSent, info.sent_total_bytes},
634 { StatsReport::kStatsValueNamePacketsSent, info.sent_total_packets }, 634 {StatsReport::kStatsValueNamePacketsSent, info.sent_total_packets},
635 { StatsReport::kStatsValueNameRtt, info.rtt }, 635 {StatsReport::kStatsValueNameRtt, info.rtt},
636 { StatsReport::kStatsValueNameSendPacketsDiscarded, 636 {StatsReport::kStatsValueNameSendPacketsDiscarded,
637 info.sent_discarded_packets }, 637 info.sent_discarded_packets},
638 {StatsReport::kStatsValueNameSentPingRequestsTotal,
639 info.sent_ping_requests_total},
640 {StatsReport::kStatsValueNameSentPingRequestsBeforeFirstResponse,
641 info.sent_ping_requests_before_first_response},
642 {StatsReport::kStatsValueNameSentPingResponses, info.sent_ping_responses},
643 {StatsReport::kStatsValueNameRecvPingRequests, info.recv_ping_requests},
644 {StatsReport::kStatsValueNameRecvPingResponses, info.recv_ping_responses},
638 }; 645 };
639 for (const auto& i : int64s) 646 for (const auto& i : int64s)
640 report->AddInt64(i.name, i.value); 647 report->AddInt64(i.name, i.value);
641 648
642 report->AddString(StatsReport::kStatsValueNameLocalAddress, 649 report->AddString(StatsReport::kStatsValueNameLocalAddress,
643 info.local_candidate.address().ToString()); 650 info.local_candidate.address().ToString());
644 report->AddString(StatsReport::kStatsValueNameLocalCandidateType, 651 report->AddString(StatsReport::kStatsValueNameLocalCandidateType,
645 info.local_candidate.type()); 652 info.local_candidate.type());
646 report->AddString(StatsReport::kStatsValueNameRemoteAddress, 653 report->AddString(StatsReport::kStatsValueNameRemoteAddress,
647 info.remote_candidate.address().ToString()); 654 info.remote_candidate.address().ToString());
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 StatsReport* report = entry.second; 1000 StatsReport* report = entry.second;
994 report->set_timestamp(stats_gathering_started_); 1001 report->set_timestamp(stats_gathering_started_);
995 } 1002 }
996 } 1003 }
997 1004
998 void StatsCollector::ClearUpdateStatsCacheForTest() { 1005 void StatsCollector::ClearUpdateStatsCacheForTest() {
999 stats_gathering_started_ = 0; 1006 stats_gathering_started_ = 0;
1000 } 1007 }
1001 1008
1002 } // namespace webrtc 1009 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/statstypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698