| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/client/jni/chromoting_jni_instance.h" | 5 #include "remoting/client/jni/chromoting_jni_instance.h" |
| 6 | 6 |
| 7 #include <android/log.h> | 7 #include <android/log.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback_helpers.h" | 13 #include "base/callback_helpers.h" |
| 14 #include "base/format_macros.h" |
| 14 #include "base/logging.h" | 15 #include "base/logging.h" |
| 15 #include "jingle/glue/thread_wrapper.h" | 16 #include "jingle/glue/thread_wrapper.h" |
| 16 #include "net/socket/client_socket_factory.h" | 17 #include "net/socket/client_socket_factory.h" |
| 17 #include "remoting/base/chromium_url_request.h" | 18 #include "remoting/base/chromium_url_request.h" |
| 18 #include "remoting/base/service_urls.h" | 19 #include "remoting/base/service_urls.h" |
| 19 #include "remoting/client/audio_player.h" | 20 #include "remoting/client/audio_player.h" |
| 20 #include "remoting/client/client_status_logger.h" | 21 #include "remoting/client/client_status_logger.h" |
| 21 #include "remoting/client/jni/android_keymap.h" | 22 #include "remoting/client/jni/android_keymap.h" |
| 22 #include "remoting/client/jni/chromoting_jni_runtime.h" | 23 #include "remoting/client/jni/chromoting_jni_runtime.h" |
| 23 #include "remoting/client/jni/jni_frame_consumer.h" | 24 #include "remoting/client/jni/jni_frame_consumer.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 } | 478 } |
| 478 | 479 |
| 479 void ChromotingJniInstance::LogPerfStats() { | 480 void ChromotingJniInstance::LogPerfStats() { |
| 480 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread()); | 481 DCHECK(jni_runtime_->network_task_runner()->BelongsToCurrentThread()); |
| 481 | 482 |
| 482 if (!stats_logging_enabled_) | 483 if (!stats_logging_enabled_) |
| 483 return; | 484 return; |
| 484 | 485 |
| 485 __android_log_print( | 486 __android_log_print( |
| 486 ANDROID_LOG_INFO, "stats", | 487 ANDROID_LOG_INFO, "stats", |
| 487 "Bandwidth:%.0f FrameRate:%.1f Capture:%.1f Encode:%.1f " | 488 "Bandwidth:%.0f FrameRate:%.1f;" |
| 488 "Decode:%.1f Render:%.1f Latency:%.0f", | 489 " (Avg, Max) Capture:%.1f, %" PRId64 " Encode:%.1f, %" PRId64 |
| 490 " Decode:%.1f, %" PRId64 " Render:%.1f, %" PRId64 " RTL:%.0f, %" PRId64, |
| 489 perf_tracker_->video_bandwidth(), perf_tracker_->video_frame_rate(), | 491 perf_tracker_->video_bandwidth(), perf_tracker_->video_frame_rate(), |
| 490 perf_tracker_->video_capture_ms(), perf_tracker_->video_encode_ms(), | 492 perf_tracker_->video_capture_ms().Average(), |
| 491 perf_tracker_->video_decode_ms(), perf_tracker_->video_paint_ms(), | 493 perf_tracker_->video_capture_ms().Max(), |
| 492 perf_tracker_->round_trip_ms()); | 494 perf_tracker_->video_encode_ms().Average(), |
| 495 perf_tracker_->video_encode_ms().Max(), |
| 496 perf_tracker_->video_decode_ms().Average(), |
| 497 perf_tracker_->video_decode_ms().Max(), |
| 498 perf_tracker_->video_paint_ms().Average(), |
| 499 perf_tracker_->video_paint_ms().Max(), |
| 500 perf_tracker_->round_trip_ms().Average(), |
| 501 perf_tracker_->round_trip_ms().Max()); |
| 493 | 502 |
| 494 client_status_logger_->LogStatistics(perf_tracker_.get()); | 503 client_status_logger_->LogStatistics(perf_tracker_.get()); |
| 495 | 504 |
| 496 jni_runtime_->network_task_runner()->PostDelayedTask( | 505 jni_runtime_->network_task_runner()->PostDelayedTask( |
| 497 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), | 506 FROM_HERE, base::Bind(&ChromotingJniInstance::LogPerfStats, this), |
| 498 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); | 507 base::TimeDelta::FromMilliseconds(kPerfStatsIntervalMs)); |
| 499 } | 508 } |
| 500 | 509 |
| 501 } // namespace remoting | 510 } // namespace remoting |
| OLD | NEW |