OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/perftimer.h" | 11 #include "base/perftimer.h" |
12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/test/test_file_util.h" | 14 #include "base/test/test_file_util.h" |
15 #include "chrome/browser/visitedlink/visitedlink_master.h" | 15 #include "chrome/browser/visitedlink/visitedlink_master.h" |
| 16 #include "googleurl/src/gurl.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
17 | 18 |
18 using base::TimeDelta; | 19 using base::TimeDelta; |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 // how we generate URLs, note that the two strings should be the same length | 23 // how we generate URLs, note that the two strings should be the same length |
23 const int add_count = 10000; | 24 const int add_count = 10000; |
24 const int load_test_add_count = 250000; | 25 const int load_test_add_count = 250000; |
25 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; | 26 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 double cold_sum = 0, hot_sum = 0; | 189 double cold_sum = 0, hot_sum = 0; |
189 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 190 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
190 cold_sum += cold_load_times[i]; | 191 cold_sum += cold_load_times[i]; |
191 hot_sum += hot_load_times[i]; | 192 hot_sum += hot_load_times[i]; |
192 } | 193 } |
193 LogPerfResult("Visited_link_cold_load_time", | 194 LogPerfResult("Visited_link_cold_load_time", |
194 cold_sum / cold_load_times.size(), "ms"); | 195 cold_sum / cold_load_times.size(), "ms"); |
195 LogPerfResult("Visited_link_hot_load_time", | 196 LogPerfResult("Visited_link_hot_load_time", |
196 hot_sum / hot_load_times.size(), "ms"); | 197 hot_sum / hot_load_times.size(), "ms"); |
197 } | 198 } |
OLD | NEW |