OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 StatsReport* StatsCollector::AddConnectionInfoReport( | 596 StatsReport* StatsCollector::AddConnectionInfoReport( |
597 const std::string& content_name, int component, int connection_id, | 597 const std::string& content_name, int component, int connection_id, |
598 const StatsReport::Id& channel_report_id, | 598 const StatsReport::Id& channel_report_id, |
599 const cricket::ConnectionInfo& info) { | 599 const cricket::ConnectionInfo& info) { |
600 StatsReport::Id id(StatsReport::NewCandidatePairId(content_name, component, | 600 StatsReport::Id id(StatsReport::NewCandidatePairId(content_name, component, |
601 connection_id)); | 601 connection_id)); |
602 StatsReport* report = reports_.ReplaceOrAddNew(id); | 602 StatsReport* report = reports_.ReplaceOrAddNew(id); |
603 report->set_timestamp(stats_gathering_started_); | 603 report->set_timestamp(stats_gathering_started_); |
604 | 604 |
605 const BoolForAdd bools[] = { | 605 const BoolForAdd bools[] = { |
606 { StatsReport::kStatsValueNameActiveConnection, info.best_connection }, | 606 {StatsReport::kStatsValueNameActiveConnection, info.best_connection}, |
607 { StatsReport::kStatsValueNameReadable, info.readable }, | 607 {StatsReport::kStatsValueNameReceiving, info.receiving}, |
608 { StatsReport::kStatsValueNameWritable, info.writable }, | 608 {StatsReport::kStatsValueNameWritable, info.writable}, |
609 }; | 609 }; |
610 for (const auto& b : bools) | 610 for (const auto& b : bools) |
611 report->AddBoolean(b.name, b.value); | 611 report->AddBoolean(b.name, b.value); |
612 | 612 |
613 report->AddId(StatsReport::kStatsValueNameChannelId, channel_report_id); | 613 report->AddId(StatsReport::kStatsValueNameChannelId, channel_report_id); |
614 report->AddId(StatsReport::kStatsValueNameLocalCandidateId, | 614 report->AddId(StatsReport::kStatsValueNameLocalCandidateId, |
615 AddCandidateReport(info.local_candidate, true)->id()); | 615 AddCandidateReport(info.local_candidate, true)->id()); |
616 report->AddId(StatsReport::kStatsValueNameRemoteCandidateId, | 616 report->AddId(StatsReport::kStatsValueNameRemoteCandidateId, |
617 AddCandidateReport(info.remote_candidate, false)->id()); | 617 AddCandidateReport(info.remote_candidate, false)->id()); |
618 | 618 |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 StatsReport* report = entry.second; | 933 StatsReport* report = entry.second; |
934 report->set_timestamp(stats_gathering_started_); | 934 report->set_timestamp(stats_gathering_started_); |
935 } | 935 } |
936 } | 936 } |
937 | 937 |
938 void StatsCollector::ClearUpdateStatsCacheForTest() { | 938 void StatsCollector::ClearUpdateStatsCacheForTest() { |
939 stats_gathering_started_ = 0; | 939 stats_gathering_started_ = 0; |
940 } | 940 } |
941 | 941 |
942 } // namespace webrtc | 942 } // namespace webrtc |
OLD | NEW |