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

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log.cc

Issue 2996933003: Add logging of host lookups made by TurnPort to the RtcEventLog. (Closed)
Patch Set: review Created 3 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void LogAudioNetworkAdaptation( 87 void LogAudioNetworkAdaptation(
88 const AudioEncoderRuntimeConfig& config) override; 88 const AudioEncoderRuntimeConfig& config) override;
89 void LogProbeClusterCreated(int id, 89 void LogProbeClusterCreated(int id,
90 int bitrate_bps, 90 int bitrate_bps,
91 int min_probes, 91 int min_probes,
92 int min_bytes) override; 92 int min_bytes) override;
93 void LogProbeResultSuccess(int id, int bitrate_bps) override; 93 void LogProbeResultSuccess(int id, int bitrate_bps) override;
94 void LogProbeResultFailure(int id, 94 void LogProbeResultFailure(int id,
95 ProbeFailureReason failure_reason) override; 95 ProbeFailureReason failure_reason) override;
96 96
97 void LogHostLookupResult(int error,
98 int64_t elapsed_time_in_milliseconds) override;
99
97 private: 100 private:
98 // Private constructor to ensure that creation is done by RtcEventLog::Create. 101 // Private constructor to ensure that creation is done by RtcEventLog::Create.
99 RtcEventLogImpl(); 102 RtcEventLogImpl();
100 103
101 void StoreEvent(std::unique_ptr<rtclog::Event> event); 104 void StoreEvent(std::unique_ptr<rtclog::Event> event);
102 void LogProbeResult(int id, 105 void LogProbeResult(int id,
103 rtclog::BweProbeResult::ResultType result, 106 rtclog::BweProbeResult::ResultType result,
104 int bitrate_bps); 107 int bitrate_bps);
105 108
106 static volatile int log_count_; 109 static volatile int log_count_;
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 event->set_type(rtclog::Event::BWE_PROBE_RESULT_EVENT); 561 event->set_type(rtclog::Event::BWE_PROBE_RESULT_EVENT);
559 562
560 auto probe_result = event->mutable_probe_result(); 563 auto probe_result = event->mutable_probe_result();
561 probe_result->set_id(id); 564 probe_result->set_id(id);
562 probe_result->set_result(result); 565 probe_result->set_result(result);
563 if (result == rtclog::BweProbeResult::SUCCESS) 566 if (result == rtclog::BweProbeResult::SUCCESS)
564 probe_result->set_bitrate_bps(bitrate_bps); 567 probe_result->set_bitrate_bps(bitrate_bps);
565 StoreEvent(std::move(event)); 568 StoreEvent(std::move(event));
566 } 569 }
567 570
571 void RtcEventLogImpl::LogHostLookupResult(
572 int error,
573 int64_t host_lookup_time_ms) {
574 std::unique_ptr<rtclog::Event> event(new rtclog::Event());
575 event->set_timestamp_us(rtc::TimeMicros());
576 event->set_type(rtclog::Event::HOST_LOOKUP_EVENT);
577 auto result = event->mutable_host_lookup_result();
578 result->set_error(error);
579 result->set_host_lookup_time_ms(host_lookup_time_ms);
580 StoreEvent(std::move(event));
581 }
582
568 void RtcEventLogImpl::StoreEvent(std::unique_ptr<rtclog::Event> event) { 583 void RtcEventLogImpl::StoreEvent(std::unique_ptr<rtclog::Event> event) {
569 RTC_DCHECK(event.get() != nullptr); 584 RTC_DCHECK(event.get() != nullptr);
570 if (!event_queue_.Insert(&event)) { 585 if (!event_queue_.Insert(&event)) {
571 LOG(LS_ERROR) << "WebRTC event log queue full. Dropping event."; 586 LOG(LS_ERROR) << "WebRTC event log queue full. Dropping event.";
572 } 587 }
573 helper_thread_.SignalNewEvent(); 588 helper_thread_.SignalNewEvent();
574 } 589 }
575 590
576 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, 591 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name,
577 rtclog::EventStream* result) { 592 rtclog::EventStream* result) {
(...skipping 28 matching lines...) Expand all
606 #else 621 #else
607 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 622 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
608 #endif // ENABLE_RTC_EVENT_LOG 623 #endif // ENABLE_RTC_EVENT_LOG
609 } 624 }
610 625
611 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { 626 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() {
612 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); 627 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl());
613 } 628 }
614 629
615 } // namespace webrtc 630 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log.h ('k') | webrtc/logging/rtc_event_log/rtc_event_log.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698