OLD | NEW |
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 Loading... |
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 | |
100 private: | 97 private: |
101 // Private constructor to ensure that creation is done by RtcEventLog::Create. | 98 // Private constructor to ensure that creation is done by RtcEventLog::Create. |
102 RtcEventLogImpl(); | 99 RtcEventLogImpl(); |
103 | 100 |
104 void StoreEvent(std::unique_ptr<rtclog::Event> event); | 101 void StoreEvent(std::unique_ptr<rtclog::Event> event); |
105 void LogProbeResult(int id, | 102 void LogProbeResult(int id, |
106 rtclog::BweProbeResult::ResultType result, | 103 rtclog::BweProbeResult::ResultType result, |
107 int bitrate_bps); | 104 int bitrate_bps); |
108 | 105 |
109 static volatile int log_count_; | 106 static volatile int log_count_; |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 event->set_type(rtclog::Event::BWE_PROBE_RESULT_EVENT); | 558 event->set_type(rtclog::Event::BWE_PROBE_RESULT_EVENT); |
562 | 559 |
563 auto probe_result = event->mutable_probe_result(); | 560 auto probe_result = event->mutable_probe_result(); |
564 probe_result->set_id(id); | 561 probe_result->set_id(id); |
565 probe_result->set_result(result); | 562 probe_result->set_result(result); |
566 if (result == rtclog::BweProbeResult::SUCCESS) | 563 if (result == rtclog::BweProbeResult::SUCCESS) |
567 probe_result->set_bitrate_bps(bitrate_bps); | 564 probe_result->set_bitrate_bps(bitrate_bps); |
568 StoreEvent(std::move(event)); | 565 StoreEvent(std::move(event)); |
569 } | 566 } |
570 | 567 |
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 | |
583 void RtcEventLogImpl::StoreEvent(std::unique_ptr<rtclog::Event> event) { | 568 void RtcEventLogImpl::StoreEvent(std::unique_ptr<rtclog::Event> event) { |
584 RTC_DCHECK(event.get() != nullptr); | 569 RTC_DCHECK(event.get() != nullptr); |
585 if (!event_queue_.Insert(&event)) { | 570 if (!event_queue_.Insert(&event)) { |
586 LOG(LS_ERROR) << "WebRTC event log queue full. Dropping event."; | 571 LOG(LS_ERROR) << "WebRTC event log queue full. Dropping event."; |
587 } | 572 } |
588 helper_thread_.SignalNewEvent(); | 573 helper_thread_.SignalNewEvent(); |
589 } | 574 } |
590 | 575 |
591 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, | 576 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, |
592 rtclog::EventStream* result) { | 577 rtclog::EventStream* result) { |
(...skipping 28 matching lines...) Expand all Loading... |
621 #else | 606 #else |
622 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 607 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
623 #endif // ENABLE_RTC_EVENT_LOG | 608 #endif // ENABLE_RTC_EVENT_LOG |
624 } | 609 } |
625 | 610 |
626 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 611 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
627 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 612 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
628 } | 613 } |
629 | 614 |
630 } // namespace webrtc | 615 } // namespace webrtc |
OLD | NEW |