diff options
author | newt <newt@chromium.org> | 2016-03-22 19:56:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 02:58:42 +0000 |
commit | 53300ca20e00981cc46a30395a635246d154ddd3 (patch) | |
tree | 625a9c68ea0ff3c2d4fc7adf167f3b610057840c | |
parent | 24994728bb74a3ef84b84db0c6d9f45e5d410274 (diff) | |
download | chromium_src-53300ca20e00981cc46a30395a635246d154ddd3.zip chromium_src-53300ca20e00981cc46a30395a635246d154ddd3.tar.gz chromium_src-53300ca20e00981cc46a30395a635246d154ddd3.tar.bz2 |
Revert of Show max latency on client's status bar (patchset #8 id:140001 of https://codereview.chromium.org/1811833002/ )
Reason for revert:
Caused compile failure on 64-bit Android bots. See crbug.com/597155
Original issue's description:
> Show max latency on client's status bar
>
> Will later also consider storing max latency data in server
>
> BUG=560950
>
> Committed: https://crrev.com/e37a467453f3814a9ecb0eb6769bd7c58b61cbae
> Cr-Commit-Position: refs/heads/master@{#382663}
TBR=sergeyu@chromium.org,kelvinp@chromium.org,dbeam@chromium.org,yuweih@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=560950
Review URL: https://codereview.chromium.org/1817093005
Cr-Commit-Position: refs/heads/master@{#382777}
-rw-r--r-- | remoting/base/BUILD.gn | 2 | ||||
-rw-r--r-- | remoting/base/running_average.cc (renamed from remoting/base/running_samples.cc) | 26 | ||||
-rw-r--r-- | remoting/base/running_average.h (renamed from remoting/base/running_samples.h) | 30 | ||||
-rw-r--r-- | remoting/base/running_average_unittest.cc | 60 | ||||
-rw-r--r-- | remoting/base/running_samples_unittest.cc | 92 | ||||
-rw-r--r-- | remoting/client/jni/chromoting_jni_instance.cc | 18 | ||||
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 15 | ||||
-rw-r--r-- | remoting/client/server_log_entry_client.cc | 10 | ||||
-rw-r--r-- | remoting/protocol/capture_scheduler.h | 6 | ||||
-rw-r--r-- | remoting/protocol/performance_tracker.h | 22 | ||||
-rw-r--r-- | remoting/remoting_srcs.gypi | 4 | ||||
-rw-r--r-- | remoting/remoting_test.gypi | 2 | ||||
-rw-r--r-- | remoting/webapp/base/js/chromoting_event.js | 10 | ||||
-rw-r--r-- | remoting/webapp/base/js/connection_stats.js | 31 | ||||
-rw-r--r-- | remoting/webapp/base/js/session_logger.js | 5 | ||||
-rw-r--r-- | remoting/webapp/base/js/stats_accumulator.js | 25 |
16 files changed, 122 insertions, 236 deletions
diff --git a/remoting/base/BUILD.gn b/remoting/base/BUILD.gn index 23dcad1..97dc3aa 100644 --- a/remoting/base/BUILD.gn +++ b/remoting/base/BUILD.gn @@ -66,7 +66,7 @@ source_set("unit_tests") { "rate_counter_unittest.cc", "rsa_key_pair_unittest.cc", "run_all_unittests.cc", - "running_samples_unittest.cc", + "running_average_unittest.cc", "test_rsa_key_pair.h", "typed_buffer_unittest.cc", "util_unittest.cc", diff --git a/remoting/base/running_samples.cc b/remoting/base/running_average.cc index d76a1a6..5e24c0d 100644 --- a/remoting/base/running_samples.cc +++ b/remoting/base/running_average.cc @@ -1,23 +1,22 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "remoting/base/running_samples.h" - -#include <algorithm> +#include "remoting/base/running_average.h" #include "base/logging.h" namespace remoting { -RunningSamples::RunningSamples(int window_size) - : window_size_(window_size) { +RunningAverage::RunningAverage(int window_size) + : window_size_(window_size), + sum_(0) { DCHECK_GT(window_size, 0); } -RunningSamples::~RunningSamples() {} +RunningAverage::~RunningAverage() {} -void RunningSamples::Record(int64_t value) { +void RunningAverage::Record(int64_t value) { DCHECK(thread_checker_.CalledOnValidThread()); data_points_.push_back(value); @@ -29,7 +28,7 @@ void RunningSamples::Record(int64_t value) { } } -double RunningSamples::Average() const { +double RunningAverage::Average() { DCHECK(thread_checker_.CalledOnValidThread()); if (data_points_.empty()) @@ -37,13 +36,4 @@ double RunningSamples::Average() const { return static_cast<double>(sum_) / data_points_.size(); } -int64_t RunningSamples::Max() const { - DCHECK(thread_checker_.CalledOnValidThread()); - - if (data_points_.empty()) - return 0; - - return *std::max_element(data_points_.begin(), data_points_.end()); -} - } // namespace remoting diff --git a/remoting/base/running_samples.h b/remoting/base/running_average.h index 3f5078d..e41234e 100644 --- a/remoting/base/running_samples.h +++ b/remoting/base/running_average.h @@ -1,9 +1,9 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef REMOTING_BASE_RUNNING_SAMPLES_H_ -#define REMOTING_BASE_RUNNING_SAMPLES_H_ +#ifndef REMOTING_BASE_RUNNING_AVERAGE_H_ +#define REMOTING_BASE_RUNNING_AVERAGE_H_ #include <stddef.h> #include <stdint.h> @@ -15,26 +15,20 @@ namespace remoting { -// Calculates the maximum or average of the most recent N recorded samples. +// Calculates the average of the most recent N recorded samples. // This is typically used to smooth out random variation in point samples // over bandwidth, frame rate, etc. -class RunningSamples { +class RunningAverage { public: - // Constructs a running sample helper that stores |window_size| most - // recent samples. - explicit RunningSamples(int window_size); - virtual ~RunningSamples(); + // Constructs a helper to average over the |window_size| most recent samples. + explicit RunningAverage(int window_size); + virtual ~RunningAverage(); // Records a point sample. void Record(int64_t value); // Returns the average over up to |window_size| of the most recent samples. - // 0 if no sample available - double Average() const; - - // Returns the max over up to |window_size| of the most recent samples. - // 0 if no sample available - int64_t Max() const; + double Average(); private: // Stores the desired window size, as size_t to avoid casting when comparing @@ -45,13 +39,13 @@ class RunningSamples { std::deque<int64_t> data_points_; // Holds the sum of the samples in |data_points_|. - int64_t sum_ = 0; + int64_t sum_; base::ThreadChecker thread_checker_; - DISALLOW_COPY_AND_ASSIGN(RunningSamples); + DISALLOW_COPY_AND_ASSIGN(RunningAverage); }; } // namespace remoting -#endif // REMOTING_BASE_RUNNING_SAMPLES_H_ +#endif // REMOTING_BASE_RUNNING_AVERAGE_H_ diff --git a/remoting/base/running_average_unittest.cc b/remoting/base/running_average_unittest.cc new file mode 100644 index 0000000..e731573 --- /dev/null +++ b/remoting/base/running_average_unittest.cc @@ -0,0 +1,60 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <stddef.h> +#include <stdint.h> + +#include "base/macros.h" +#include "remoting/base/running_average.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace remoting { + +static const int64_t kTestValues[] = { 10, 20, 30, 10, 25, 16, 15 }; + +// Average across a single element, i.e. just return the most recent. +TEST(RunningAverageTest, OneElementWindow) { + RunningAverage running_average(1); + EXPECT_EQ(0, running_average.Average()); + + for (size_t i = 0; i < arraysize(kTestValues); ++i) { + running_average.Record(kTestValues[i]); + EXPECT_EQ(static_cast<double>(kTestValues[i]), running_average.Average()); + } +} + +// Average the two most recent elements. +TEST(RunningAverageTest, TwoElementWindow) { + RunningAverage running_average(2); + EXPECT_EQ(0, running_average.Average()); + + for (size_t i = 0; i < arraysize(kTestValues); ++i) { + running_average.Record(kTestValues[i]); + + double expected = kTestValues[i]; + if (i > 0) + expected = (expected + kTestValues[i-1]) / 2; + + EXPECT_EQ(expected, running_average.Average()); + } +} + +// Average across all the elements if the window size exceeds the element count. +TEST(RunningAverageTest, LongWindow) { + RunningAverage running_average(arraysize(kTestValues) + 1); + EXPECT_EQ(0, running_average.Average()); + + for (size_t i = 0; i < arraysize(kTestValues); ++i) { + running_average.Record(kTestValues[i]); + + double expected = 0.0; + for (size_t j = 0; j <= i; ++j) + expected += kTestValues[j]; + expected /= i + 1; + + EXPECT_EQ(expected, running_average.Average()); + } +} + +} // namespace remoting diff --git a/remoting/base/running_samples_unittest.cc b/remoting/base/running_samples_unittest.cc deleted file mode 100644 index 2c2c7f5..0000000 --- a/remoting/base/running_samples_unittest.cc +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <stddef.h> -#include <stdint.h> - -#include "base/macros.h" -#include "remoting/base/running_samples.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace remoting { - -typedef void (*TestFunction)(size_t i, RunningSamples& samples); - -static const int64_t kTestValues[] = { 10, 20, 30, 10, 25, 16, 15 }; - -// Test framework that verifies average() and max() at beginning, iterates -// through all elements and meanwhile calls your own test function -static void TestFramework(int windowSize, TestFunction testFn) { - RunningSamples samples(windowSize); - EXPECT_EQ(0, samples.Average()); - EXPECT_EQ(0, samples.Max()); - - for (size_t i = 0; i < arraysize(kTestValues); ++i) { - samples.Record(kTestValues[i]); - testFn(i, samples); - } -} - -// Average across a single element, i.e. just return the most recent. -TEST(RunningSamplesTest, AverageOneElementWindow) { - TestFramework(1, [](size_t i, RunningSamples& samples) { - EXPECT_EQ(static_cast<double>(kTestValues[i]), samples.Average()); - }); -} - -// Average the two most recent elements. -TEST(RunningSamplesTest, AverageTwoElementWindow) { - TestFramework(2, [](size_t i, RunningSamples& samples) { - double expected = kTestValues[i]; - if (i > 0) - expected = (expected + kTestValues[i-1]) / 2; - - EXPECT_EQ(expected, samples.Average()); - }); -} - -// Average across all the elements if the window size exceeds the element count. -TEST(RunningSamplesTest, AverageLongWindow) { - TestFramework(arraysize(kTestValues) + 1, - [](size_t i, RunningSamples& samples) { - double expected = 0.0; - for (size_t j = 0; j <= i; ++j) - expected += kTestValues[j]; - expected /= i + 1; - - EXPECT_EQ(expected, samples.Average()); - }); -} - -// Max of a single element, i.e. just return the most recent. -TEST(RunningSamplesTest, MaxOneElementWindow) { - TestFramework(1, [](size_t i, RunningSamples& samples) { - EXPECT_EQ(static_cast<double>(kTestValues[i]), samples.Max()); - }); -} - -// Max of the two most recent elements. -TEST(RunningSamplesTest, MaxTwoElementWindow) { - TestFramework(2, [](size_t i, RunningSamples& samples) { - double expected = kTestValues[i]; - if (i > 0) - expected = expected > kTestValues[i-1] ? expected : kTestValues[i-1]; - - EXPECT_EQ(expected, samples.Max()); - }); -} - -// Max of all the elements if the window size exceeds the element count. -TEST(RunningSamplesTest, MaxLongWindow) { - TestFramework(arraysize(kTestValues) + 1, - [](size_t i, RunningSamples& samples) { - int64_t expected = -1; - for (size_t j = 0; j <= i; ++j) - expected = expected > kTestValues[j] ? expected : kTestValues[j]; - - EXPECT_EQ(expected, samples.Max()); - }); -} - -} // namespace remoting
\ No newline at end of file diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc index 1fd5b1c..7d8b7f8 100644 --- a/remoting/client/jni/chromoting_jni_instance.cc +++ b/remoting/client/jni/chromoting_jni_instance.cc @@ -484,20 +484,12 @@ void ChromotingJniInstance::LogPerfStats() { __android_log_print( ANDROID_LOG_INFO, "stats", - "Bandwidth:%.0f FrameRate:%.1f; " - "(Avg, Max) Capture:%.1f, %lld Encode:%.1f, %lld Decode:%.1f, %lld " - "Render:%.1f, %lld RTL:%.0f, %lld", + "Bandwidth:%.0f FrameRate:%.1f Capture:%.1f Encode:%.1f " + "Decode:%.1f Render:%.1f Latency:%.0f", perf_tracker_->video_bandwidth(), perf_tracker_->video_frame_rate(), - perf_tracker_->video_capture_ms().Average(), - perf_tracker_->video_capture_ms().Max(), - perf_tracker_->video_encode_ms().Average(), - perf_tracker_->video_encode_ms().Max(), - perf_tracker_->video_decode_ms().Average(), - perf_tracker_->video_decode_ms().Max(), - perf_tracker_->video_paint_ms().Average(), - perf_tracker_->video_paint_ms().Max(), - perf_tracker_->round_trip_ms().Average(), - perf_tracker_->round_trip_ms().Max()); + perf_tracker_->video_capture_ms(), perf_tracker_->video_encode_ms(), + perf_tracker_->video_decode_ms(), perf_tracker_->video_paint_ms(), + perf_tracker_->round_trip_ms()); client_status_logger_->LogStatistics(perf_tracker_.get()); diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index a7c5601..e0ca0d5 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -1034,16 +1034,11 @@ void ChromotingInstance::UpdatePerfStatsInUI() { scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); data->SetDouble("videoBandwidth", perf_tracker_.video_bandwidth()); data->SetDouble("videoFrameRate", perf_tracker_.video_frame_rate()); - data->SetDouble("captureLatency", perf_tracker_.video_capture_ms().Average()); - data->SetDouble("maxCaptureLatency", perf_tracker_.video_capture_ms().Max()); - data->SetDouble("encodeLatency", perf_tracker_.video_encode_ms().Average()); - data->SetDouble("maxEncodeLatency", perf_tracker_.video_encode_ms().Max()); - data->SetDouble("decodeLatency", perf_tracker_.video_decode_ms().Average()); - data->SetDouble("maxDecodeLatency", perf_tracker_.video_decode_ms().Max()); - data->SetDouble("renderLatency", perf_tracker_.video_paint_ms().Average()); - data->SetDouble("maxRenderLatency", perf_tracker_.video_paint_ms().Max()); - data->SetDouble("roundtripLatency", perf_tracker_.round_trip_ms().Average()); - data->SetDouble("maxRoundtripLatency", perf_tracker_.round_trip_ms().Max()); + data->SetDouble("captureLatency", perf_tracker_.video_capture_ms()); + data->SetDouble("encodeLatency", perf_tracker_.video_encode_ms()); + data->SetDouble("decodeLatency", perf_tracker_.video_decode_ms()); + data->SetDouble("renderLatency", perf_tracker_.video_paint_ms()); + data->SetDouble("roundtripLatency", perf_tracker_.round_trip_ms()); PostLegacyJsonMessage("onPerfStats", std::move(data)); } diff --git a/remoting/client/server_log_entry_client.cc b/remoting/client/server_log_entry_client.cc index 290165f..0686159 100644 --- a/remoting/client/server_log_entry_client.cc +++ b/remoting/client/server_log_entry_client.cc @@ -117,15 +117,15 @@ scoped_ptr<ServerLogEntry> MakeLogEntryForStatistics( entry->Set("video-bandwidth", StringPrintf("%.2f", perf_tracker->video_bandwidth())); entry->Set("capture-latency", - StringPrintf("%.2f", perf_tracker->video_capture_ms().Average())); + StringPrintf("%.2f", perf_tracker->video_capture_ms())); entry->Set("encode-latency", - StringPrintf("%.2f", perf_tracker->video_encode_ms().Average())); + StringPrintf("%.2f", perf_tracker->video_encode_ms())); entry->Set("decode-latency", - StringPrintf("%.2f", perf_tracker->video_decode_ms().Average())); + StringPrintf("%.2f", perf_tracker->video_decode_ms())); entry->Set("render-latency", - StringPrintf("%.2f", perf_tracker->video_paint_ms().Average())); + StringPrintf("%.2f", perf_tracker->video_frame_rate())); entry->Set("roundtrip-latency", - StringPrintf("%.2f", perf_tracker->round_trip_ms().Average())); + StringPrintf("%.2f", perf_tracker->round_trip_ms())); return entry; } diff --git a/remoting/protocol/capture_scheduler.h b/remoting/protocol/capture_scheduler.h index 3f4369a..54e2229d 100644 --- a/remoting/protocol/capture_scheduler.h +++ b/remoting/protocol/capture_scheduler.h @@ -13,7 +13,7 @@ #include "base/time/tick_clock.h" #include "base/time/time.h" #include "base/timer/timer.h" -#include "remoting/base/running_samples.h" +#include "remoting/base/running_average.h" #include "remoting/protocol/video_feedback_stub.h" namespace remoting { @@ -88,8 +88,8 @@ class CaptureScheduler : public VideoFeedbackStub { int num_of_processors_; - RunningSamples capture_time_; - RunningSamples encode_time_; + RunningAverage capture_time_; + RunningAverage encode_time_; // Number of frames pending encoding. int num_encoding_frames_; diff --git a/remoting/protocol/performance_tracker.h b/remoting/protocol/performance_tracker.h index c31ca91..3e5bf2c 100644 --- a/remoting/protocol/performance_tracker.h +++ b/remoting/protocol/performance_tracker.h @@ -13,7 +13,7 @@ #include "base/macros.h" #include "base/timer/timer.h" #include "remoting/base/rate_counter.h" -#include "remoting/base/running_samples.h" +#include "remoting/base/running_average.h" namespace remoting { @@ -49,11 +49,11 @@ class PerformanceTracker { double video_bandwidth() { return video_bandwidth_.Rate(); } double video_frame_rate() { return video_frame_rate_.Rate(); } double video_packet_rate() { return video_packet_rate_.Rate(); } - const RunningSamples& video_capture_ms() { return video_capture_ms_; } - const RunningSamples& video_encode_ms() { return video_encode_ms_; } - const RunningSamples& video_decode_ms() { return video_decode_ms_; } - const RunningSamples& video_paint_ms() { return video_paint_ms_; } - const RunningSamples& round_trip_ms() { return round_trip_ms_; } + double video_capture_ms() { return video_capture_ms_.Average(); } + double video_encode_ms() { return video_encode_ms_.Average(); } + double video_decode_ms() { return video_decode_ms_.Average(); } + double video_paint_ms() { return video_paint_ms_.Average(); } + double round_trip_ms() { return round_trip_ms_.Average(); } // Record stats for a video-packet. void RecordVideoPacketStats(const VideoPacket& packet); @@ -113,11 +113,11 @@ class PerformanceTracker { // The following running-averages are uploaded to UMA per video packet and // also used for display to users, averaged over the N most recent samples. // N = kLatencySampleSize. - RunningSamples video_capture_ms_; - RunningSamples video_encode_ms_; - RunningSamples video_decode_ms_; - RunningSamples video_paint_ms_; - RunningSamples round_trip_ms_; + RunningAverage video_capture_ms_; + RunningAverage video_encode_ms_; + RunningAverage video_decode_ms_; + RunningAverage video_paint_ms_; + RunningAverage round_trip_ms_; // Used to update UMA stats, if set. UpdateUmaCustomHistogramCallback uma_custom_counts_updater_; diff --git a/remoting/remoting_srcs.gypi b/remoting/remoting_srcs.gypi index 4ab5640..d1c1ee4 100644 --- a/remoting/remoting_srcs.gypi +++ b/remoting/remoting_srcs.gypi @@ -25,8 +25,8 @@ 'base/rate_counter.h', 'base/rsa_key_pair.cc', 'base/rsa_key_pair.h', - 'base/running_samples.cc', - 'base/running_samples.h', + 'base/running_average.cc', + 'base/running_average.h', 'base/scoped_sc_handle_win.h', 'base/service_urls.cc', 'base/service_urls.h', diff --git a/remoting/remoting_test.gypi b/remoting/remoting_test.gypi index 5f193e9..761607e 100644 --- a/remoting/remoting_test.gypi +++ b/remoting/remoting_test.gypi @@ -232,7 +232,7 @@ 'base/rate_counter_unittest.cc', 'base/rsa_key_pair_unittest.cc', 'base/run_all_unittests.cc', - 'base/running_samples_unittest.cc', + 'base/running_average_unittest.cc', 'base/test_rsa_key_pair.h', 'base/typed_buffer_unittest.cc', 'base/util_unittest.cc', diff --git a/remoting/webapp/base/js/chromoting_event.js b/remoting/webapp/base/js/chromoting_event.js index 0f6fedd..476f879c 100644 --- a/remoting/webapp/base/js/chromoting_event.js +++ b/remoting/webapp/base/js/chromoting_event.js @@ -79,16 +79,6 @@ remoting.ChromotingEvent = function(type) { this.render_latency; /** @type {number} */ this.roundtrip_latency; - /** @type {number} */ - this.max_capture_latency; - /** @type {number} */ - this.max_encode_latency; - /** @type {number} */ - this.max_decode_latency; - /** @type {number} */ - this.max_render_latency; - /** @type {number} */ - this.max_roundtrip_latency; /** @type {remoting.ChromotingEvent.Mode} */ this.mode; /** @type {remoting.ChromotingEvent.SignalStrategyType} */ diff --git a/remoting/webapp/base/js/connection_stats.js b/remoting/webapp/base/js/connection_stats.js index c78c244..d08a527 100644 --- a/remoting/webapp/base/js/connection_stats.js +++ b/remoting/webapp/base/js/connection_stats.js @@ -123,36 +123,23 @@ remoting.ConnectionStats.prototype.update = function(stats) { /** * @param {number} value * @param {string} units - * @param {number} number of digits after decimal. * @return {string} Formatted number. */ - function formatStatNumber(value, units, digits) { + function formatStatNumber(value, units) { if (value != undefined) { - return value.toFixed(digits) + ' ' + units; + return value.toFixed(2) + ' ' + units; } else { return "n/a"; } } - /** - * @param {string} type - * @param {number} avg - * @param {number} max - * @return {string} "type: avg, max; " e.g. "RTT: 8.0, 13; " - */ - function formatStat(type, avg, max) { - return type + ': ' + avg.toFixed(1) + ', ' + max + '; '; - } - var statistics = document.getElementById('statistics'); this.statsElement_.innerText = ( - '(avg, max in ms) ' + - formatStat('Capture', stats.captureLatency, stats.maxCaptureLatency) + - formatStat('Encode', stats.encodeLatency, stats.maxEncodeLatency) + - formatStat('Decode', stats.decodeLatency, stats.maxDecodeLatency) + - formatStat('Render', stats.renderLatency, stats.maxRenderLatency) + - formatStat('RTT', stats.roundtripLatency, stats.maxRoundtripLatency) + - 'Bandwidth: ' + formatStatNumber(videoBandwidth, units, 2) + '; ' + - 'Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps', 1) - ); + 'Bandwidth: ' + formatStatNumber(videoBandwidth, units) + + ', Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps') + + ', Capture: ' + formatStatNumber(stats.captureLatency, 'ms') + + ', Encode: ' + formatStatNumber(stats.encodeLatency, 'ms') + + ', Decode: ' + formatStatNumber(stats.decodeLatency, 'ms') + + ', Render: ' + formatStatNumber(stats.renderLatency, 'ms') + + ', Latency: ' + formatStatNumber(stats.roundtripLatency, 'ms')); }; diff --git a/remoting/webapp/base/js/session_logger.js b/remoting/webapp/base/js/session_logger.js index 4e4eba9..6f26c9a 100644 --- a/remoting/webapp/base/js/session_logger.js +++ b/remoting/webapp/base/js/session_logger.js @@ -291,11 +291,6 @@ remoting.SessionLogger.prototype.makeStats_ = function() { entry.decode_latency = perfStats.decodeLatency; entry.render_latency = perfStats.renderLatency; entry.roundtrip_latency = perfStats.roundtripLatency; - entry.max_capture_latency = perfStats.maxCaptureLatency; - entry.max_encode_latency = perfStats.maxEncodeLatency; - entry.max_decode_latency = perfStats.maxDecodeLatency; - entry.max_render_latency = perfStats.maxRenderLatency; - entry.max_roundtrip_latency = perfStats.maxRoundtripLatency; return entry; } return null; diff --git a/remoting/webapp/base/js/stats_accumulator.js b/remoting/webapp/base/js/stats_accumulator.js index e8bda09..e0edd49 100644 --- a/remoting/webapp/base/js/stats_accumulator.js +++ b/remoting/webapp/base/js/stats_accumulator.js @@ -94,26 +94,6 @@ remoting.StatsAccumulator.prototype.calcMean = function(key) { }; /** - * Finds the max of the values for a given key. - * - * @param {string} key - * @return {number} the max of the values for that key - */ -remoting.StatsAccumulator.prototype.calcMax = function(key) { - /** - * @param {Array<number>} values - * @return {number} - */ - var calcMax = function(values) { - if (!values || !values.length) { - return 0; - } - return Math.max.apply(null, values); - }; - return this.map(key, calcMax); -}; - -/** * Applies a given map to the list of values for a given key. * * @param {string} key @@ -151,15 +131,10 @@ remoting.StatsAccumulator.prototype.getPerfStats = function() { var stats = new remoting.ClientSession.PerfStats(); stats.videoBandwidth = this.calcMean('videoBandwidth'); stats.captureLatency = this.calcMean('captureLatency'); - stats.maxCaptureLatency = this.calcMax('maxCaptureLatency'); stats.encodeLatency = this.calcMean('encodeLatency'); - stats.maxEncodeLatency = this.calcMax('maxEncodeLatency'); stats.decodeLatency = this.calcMean('decodeLatency'); - stats.maxDecodeLatency = this.calcMax('maxDecodeLatency'); stats.renderLatency = this.calcMean('renderLatency'); - stats.maxRenderLatency = this.calcMax('maxRenderLatency'); stats.roundtripLatency = this.calcMean('roundtripLatency'); - stats.maxRoundtripLatency = this.calcMax('maxRoundtripLatency'); for (var key in stats) { if (stats[key] !== 0) { |