OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <limits.h> | 5 #include <limits.h> |
6 #include <ctype.h> | 6 #include <ctype.h> |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/histogram.h" | 10 #include "base/histogram.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // considered (per suggestion from Jake Brutlag). | 54 // considered (per suggestion from Jake Brutlag). |
55 if (10 >= duration.InMinutes()) { | 55 if (10 >= duration.InMinutes()) { |
56 if (DECODING_IN_PROGRESS == decoding_status_) { | 56 if (DECODING_IN_PROGRESS == decoding_status_) { |
57 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_Latency_F", duration, | 57 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_Latency_F", duration, |
58 base::TimeDelta::FromMilliseconds(20), | 58 base::TimeDelta::FromMilliseconds(20), |
59 base::TimeDelta::FromMinutes(10), 100); | 59 base::TimeDelta::FromMinutes(10), 100); |
60 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_1st_To_Last", | 60 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_1st_To_Last", |
61 read_times_.back() - read_times_[0], | 61 read_times_.back() - read_times_[0], |
62 base::TimeDelta::FromMilliseconds(20), | 62 base::TimeDelta::FromMilliseconds(20), |
63 base::TimeDelta::FromMinutes(10), 100); | 63 base::TimeDelta::FromMinutes(10), 100); |
64 if (read_times_.size() > 3) | 64 if (read_times_.size() > 3) { |
65 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_3rd_To_4th", | 65 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_3rd_To_4th", |
66 read_times_[3] - read_times_[2], | 66 read_times_[3] - read_times_[2], |
67 base::TimeDelta::FromMilliseconds(10), | 67 base::TimeDelta::FromMilliseconds(10), |
68 base::TimeDelta::FromSeconds(3), 100); | 68 base::TimeDelta::FromSeconds(3), 100); |
| 69 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Decode_2nd_To_3rd", |
| 70 read_times_[2] - read_times_[1], |
| 71 base::TimeDelta::FromMilliseconds(10), |
| 72 base::TimeDelta::FromSeconds(3), 100); |
| 73 } |
69 UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Decode_Reads", | 74 UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Decode_Reads", |
70 read_times_.size()); | 75 read_times_.size()); |
71 UMA_HISTOGRAM_COUNTS(L"Sdch.Network_Decode_Bytes_Read", output_bytes_); | 76 UMA_HISTOGRAM_COUNTS(L"Sdch.Network_Decode_Bytes_Read", output_bytes_); |
72 } else if (PASS_THROUGH == decoding_status_) { | 77 } else if (PASS_THROUGH == decoding_status_) { |
73 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_Latency_F", | 78 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_Latency_F", |
74 duration, | 79 duration, |
75 base::TimeDelta::FromMilliseconds(20), | 80 base::TimeDelta::FromMilliseconds(20), |
76 base::TimeDelta::FromMinutes(10), 100); | 81 base::TimeDelta::FromMinutes(10), 100); |
77 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_1st_To_Last", | 82 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_1st_To_Last", |
78 read_times_.back() - read_times_[0], | 83 read_times_.back() - read_times_[0], |
79 base::TimeDelta::FromMilliseconds(20), | 84 base::TimeDelta::FromMilliseconds(20), |
80 base::TimeDelta::FromMinutes(10), 100); | 85 base::TimeDelta::FromMinutes(10), 100); |
81 if (read_times_.size() > 3) | 86 if (read_times_.size() > 3) { |
82 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_3rd_To_4th", | 87 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_3rd_To_4th", |
83 read_times_[3] - read_times_[2], | 88 read_times_[3] - read_times_[2], |
84 base::TimeDelta::FromMilliseconds(10), | 89 base::TimeDelta::FromMilliseconds(10), |
85 base::TimeDelta::FromSeconds(3), 100); | 90 base::TimeDelta::FromSeconds(3), 100); |
| 91 UMA_HISTOGRAM_CLIPPED_TIMES(L"Sdch.Network_Pass-through_2nd_To_3rd", |
| 92 read_times_[2] - read_times_[1], |
| 93 base::TimeDelta::FromMilliseconds(10), |
| 94 base::TimeDelta::FromSeconds(3), 100); |
| 95 } |
86 UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Pass-through_Reads", | 96 UMA_HISTOGRAM_COUNTS_100(L"Sdch.Network_Pass-through_Reads", |
87 read_times_.size()); | 97 read_times_.size()); |
88 } | 98 } |
89 } | 99 } |
90 } | 100 } |
91 | 101 |
92 if (dictionary_) | 102 if (dictionary_) |
93 dictionary_->Release(); | 103 dictionary_->Release(); |
94 } | 104 } |
95 | 105 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 memcpy(dest_buffer, dest_buffer_excess_.data() + dest_buffer_excess_index_, | 321 memcpy(dest_buffer, dest_buffer_excess_.data() + dest_buffer_excess_index_, |
312 amount); | 322 amount); |
313 dest_buffer_excess_index_ += amount; | 323 dest_buffer_excess_index_ += amount; |
314 if (dest_buffer_excess_.size() <= dest_buffer_excess_index_) { | 324 if (dest_buffer_excess_.size() <= dest_buffer_excess_index_) { |
315 DCHECK(dest_buffer_excess_.size() == dest_buffer_excess_index_); | 325 DCHECK(dest_buffer_excess_.size() == dest_buffer_excess_index_); |
316 dest_buffer_excess_.clear(); | 326 dest_buffer_excess_.clear(); |
317 dest_buffer_excess_index_ = 0; | 327 dest_buffer_excess_index_ = 0; |
318 } | 328 } |
319 return amount; | 329 return amount; |
320 } | 330 } |
OLD | NEW |