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" | |
17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
18 | 17 |
19 using base::TimeDelta; | 18 using base::TimeDelta; |
20 | 19 |
21 namespace { | 20 namespace { |
22 | 21 |
23 // how we generate URLs, note that the two strings should be the same length | 22 // how we generate URLs, note that the two strings should be the same length |
24 const int add_count = 10000; | 23 const int add_count = 10000; |
25 const int load_test_add_count = 250000; | 24 const int load_test_add_count = 250000; |
26 const char added_prefix[] = "http://www.google.com/stuff/something/foo?session=8
5025602345625&id=1345142319023&seq="; | 25 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... |
189 double cold_sum = 0, hot_sum = 0; | 188 double cold_sum = 0, hot_sum = 0; |
190 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { | 189 for (int i = 0; i < static_cast<int>(cold_load_times.size()); i++) { |
191 cold_sum += cold_load_times[i]; | 190 cold_sum += cold_load_times[i]; |
192 hot_sum += hot_load_times[i]; | 191 hot_sum += hot_load_times[i]; |
193 } | 192 } |
194 LogPerfResult("Visited_link_cold_load_time", | 193 LogPerfResult("Visited_link_cold_load_time", |
195 cold_sum / cold_load_times.size(), "ms"); | 194 cold_sum / cold_load_times.size(), "ms"); |
196 LogPerfResult("Visited_link_hot_load_time", | 195 LogPerfResult("Visited_link_hot_load_time", |
197 hot_sum / hot_load_times.size(), "ms"); | 196 hot_sum / hot_load_times.size(), "ms"); |
198 } | 197 } |
OLD | NEW |