diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-17 00:34:38 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-17 00:34:38 +0000 |
commit | 9db9c91eb1db09e024449309f0383932eb69a0ed (patch) | |
tree | 4795a8031a5a9e8646fa7b9c7402b5c5daaf4e62 /net | |
parent | 88dcdb78847445fb487e849d987c15694cf109cb (diff) | |
download | chromium_src-9db9c91eb1db09e024449309f0383932eb69a0ed.zip chromium_src-9db9c91eb1db09e024449309f0383932eb69a0ed.tar.gz chromium_src-9db9c91eb1db09e024449309f0383932eb69a0ed.tar.bz2 |
base: Split logging functions and PerfTimeLogger out of perftimer.h
Soon PerfTimer will move into base/timer/ directory as it is already used by
production code.
This splits the logging stuff into their owns files and also moves
PerfTimeLogger into its own files.
BUG=None
TEST=base_unittests, ipc_perftests, etc...
R=brettw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/23985006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/cookies/cookie_monster_perftest.cc | 28 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_perftest.cc | 12 | ||||
-rw-r--r-- | net/proxy/proxy_resolver_perftest.cc | 4 |
3 files changed, 22 insertions, 22 deletions
diff --git a/net/cookies/cookie_monster_perftest.cc b/net/cookies/cookie_monster_perftest.cc index 8187bcb..2bc0be8 100644 --- a/net/cookies/cookie_monster_perftest.cc +++ b/net/cookies/cookie_monster_perftest.cc @@ -8,7 +8,7 @@ #include "base/message_loop/message_loop.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" -#include "base/test/perftimer.h" +#include "base/test/perf_time_logger.h" #include "net/cookies/canonical_cookie.h" #include "net/cookies/cookie_monster.h" #include "net/cookies/cookie_monster_store_test.h" @@ -97,7 +97,7 @@ class GetCookiesCallback : public BaseCallback { TEST(ParsedCookieTest, TestParseCookies) { std::string cookie(kCookieLine); - PerfTimeLogger timer("Parsed_cookie_parse_cookies"); + base::PerfTimeLogger timer("Parsed_cookie_parse_cookies"); for (int i = 0; i < kNumCookies; ++i) { ParsedCookie pc(cookie); EXPECT_TRUE(pc.IsValid()); @@ -108,7 +108,7 @@ TEST(ParsedCookieTest, TestParseCookies) { TEST(ParsedCookieTest, TestParseBigCookies) { std::string cookie(3800, 'z'); cookie += kCookieLine; - PerfTimeLogger timer("Parsed_cookie_parse_big_cookies"); + base::PerfTimeLogger timer("Parsed_cookie_parse_big_cookies"); for (int i = 0; i < kNumCookies; ++i) { ParsedCookie pc(cookie); EXPECT_TRUE(pc.IsValid()); @@ -126,7 +126,7 @@ TEST_F(CookieMonsterTest, TestAddCookiesOnSingleHost) { SetCookieCallback setCookieCallback; // Add a bunch of cookies on a single host - PerfTimeLogger timer("Cookie_monster_add_single_host"); + base::PerfTimeLogger timer("Cookie_monster_add_single_host"); for (std::vector<std::string>::const_iterator it = cookies.begin(); it != cookies.end(); ++it) { @@ -136,14 +136,14 @@ TEST_F(CookieMonsterTest, TestAddCookiesOnSingleHost) { GetCookiesCallback getCookiesCallback; - PerfTimeLogger timer2("Cookie_monster_query_single_host"); + base::PerfTimeLogger timer2("Cookie_monster_query_single_host"); for (std::vector<std::string>::const_iterator it = cookies.begin(); it != cookies.end(); ++it) { getCookiesCallback.GetCookies(cm.get(), GURL(kGoogleURL)); } timer2.Done(); - PerfTimeLogger timer3("Cookie_monster_deleteall_single_host"); + base::PerfTimeLogger timer3("Cookie_monster_deleteall_single_host"); cm->DeleteAllAsync(CookieMonster::DeleteCallback()); base::MessageLoop::current()->RunUntilIdle(); timer3.Done(); @@ -160,7 +160,7 @@ TEST_F(CookieMonsterTest, TestAddCookieOnManyHosts) { SetCookieCallback setCookieCallback; // Add a cookie on a bunch of host - PerfTimeLogger timer("Cookie_monster_add_many_hosts"); + base::PerfTimeLogger timer("Cookie_monster_add_many_hosts"); for (std::vector<GURL>::const_iterator it = gurls.begin(); it != gurls.end(); ++it) { setCookieCallback.SetCookie(cm.get(), *it, cookie); @@ -169,14 +169,14 @@ TEST_F(CookieMonsterTest, TestAddCookieOnManyHosts) { GetCookiesCallback getCookiesCallback; - PerfTimeLogger timer2("Cookie_monster_query_many_hosts"); + base::PerfTimeLogger timer2("Cookie_monster_query_many_hosts"); for (std::vector<GURL>::const_iterator it = gurls.begin(); it != gurls.end(); ++it) { getCookiesCallback.GetCookies(cm.get(), *it); } timer2.Done(); - PerfTimeLogger timer3("Cookie_monster_deleteall_many_hosts"); + base::PerfTimeLogger timer3("Cookie_monster_deleteall_many_hosts"); cm->DeleteAllAsync(CookieMonster::DeleteCallback()); base::MessageLoop::current()->RunUntilIdle(); timer3.Done(); @@ -229,7 +229,7 @@ TEST_F(CookieMonsterTest, TestDomainTree) { std::string cookie_line = getCookiesCallback.GetCookies(cm.get(), probe_gurl); EXPECT_EQ(5, CountInString(cookie_line, '=')) << "Cookie line: " << cookie_line; - PerfTimeLogger timer("Cookie_monster_query_domain_tree"); + base::PerfTimeLogger timer("Cookie_monster_query_domain_tree"); for (int i = 0; i < kNumCookies; i++) { getCookiesCallback.GetCookies(cm.get(), probe_gurl); } @@ -269,7 +269,7 @@ TEST_F(CookieMonsterTest, TestDomainLine) { cookie_line = getCookiesCallback.GetCookies(cm.get(), probe_gurl); EXPECT_EQ(32, CountInString(cookie_line, '=')); - PerfTimeLogger timer2("Cookie_monster_query_domain_line"); + base::PerfTimeLogger timer2("Cookie_monster_query_domain_line"); for (int i = 0; i < kNumCookies; i++) { getCookiesCallback.GetCookies(cm.get(), probe_gurl); } @@ -304,7 +304,7 @@ TEST_F(CookieMonsterTest, TestImport) { // Import will happen on first access. GURL gurl("www.google.com"); CookieOptions options; - PerfTimeLogger timer("Cookie_monster_import_from_store"); + base::PerfTimeLogger timer("Cookie_monster_import_from_store"); getCookiesCallback.GetCookies(cm.get(), gurl); timer.Done(); @@ -314,7 +314,7 @@ TEST_F(CookieMonsterTest, TestImport) { TEST_F(CookieMonsterTest, TestGetKey) { scoped_refptr<CookieMonster> cm(new CookieMonster(NULL, NULL)); - PerfTimeLogger timer("Cookie_monster_get_key"); + base::PerfTimeLogger timer("Cookie_monster_get_key"); for (int i = 0; i < kNumCookies; i++) cm->GetKey("www.google.com"); timer.Done(); @@ -375,7 +375,7 @@ TEST_F(CookieMonsterTest, TestGCTimes) { // Trigger the Garbage collection we're allowed. setCookieCallback.SetCookie(cm.get(), gurl, cookie_line); - PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str()); + base::PerfTimeLogger timer((std::string("GC_") + test_case.name).c_str()); for (int i = 0; i < kNumCookies; i++) setCookieCallback.SetCookie(cm.get(), gurl, cookie_line); timer.Done(); diff --git a/net/disk_cache/disk_cache_perftest.cc b/net/disk_cache/disk_cache_perftest.cc index abf39b9..6adc4bc 100644 --- a/net/disk_cache/disk_cache_perftest.cc +++ b/net/disk_cache/disk_cache_perftest.cc @@ -9,7 +9,7 @@ #include "base/bind_helpers.h" #include "base/hash.h" #include "base/strings/string_util.h" -#include "base/test/perftimer.h" +#include "base/test/perf_time_logger.h" #include "base/test/test_file_util.h" #include "base/threading/thread.h" #include "base/timer/timer.h" @@ -53,7 +53,7 @@ bool TimeWrite(int num_entries, disk_cache::Backend* cache, MessageLoopHelper helper; CallbackTest callback(&helper, true); - PerfTimeLogger timer("Write disk cache entries"); + base::PerfTimeLogger timer("Write disk cache entries"); for (int i = 0; i < num_entries; i++) { TestEntry entry; @@ -107,7 +107,7 @@ bool TimeRead(int num_entries, disk_cache::Backend* cache, const char* message = cold ? "Read disk cache entries (cold)" : "Read disk cache entries (warm)"; - PerfTimeLogger timer(message); + base::PerfTimeLogger timer(message); for (int i = 0; i < num_entries; i++) { disk_cache::Entry* cache_entry; @@ -150,7 +150,7 @@ TEST_F(DiskCacheTest, Hash) { int seed = static_cast<int>(Time::Now().ToInternalValue()); srand(seed); - PerfTimeLogger timer("Hash disk cache keys"); + base::PerfTimeLogger timer("Hash disk cache keys"); for (int i = 0; i < 300000; i++) { std::string key = GenerateKey(true); base::Hash(key); @@ -223,7 +223,7 @@ TEST_F(DiskCacheTest, BlockFilesPerformance) { const int kNumEntries = 60000; disk_cache::Addr* address = new disk_cache::Addr[kNumEntries]; - PerfTimeLogger timer1("Fill three block-files"); + base::PerfTimeLogger timer1("Fill three block-files"); // Fill up the 32-byte block file (use three files). for (int i = 0; i < kNumEntries; i++) { @@ -232,7 +232,7 @@ TEST_F(DiskCacheTest, BlockFilesPerformance) { } timer1.Done(); - PerfTimeLogger timer2("Create and delete blocks"); + base::PerfTimeLogger timer2("Create and delete blocks"); for (int i = 0; i < 200000; i++) { int entry = rand() * (kNumEntries / RAND_MAX + 1); diff --git a/net/proxy/proxy_resolver_perftest.cc b/net/proxy/proxy_resolver_perftest.cc index 1630d9e..12ffd1b 100644 --- a/net/proxy/proxy_resolver_perftest.cc +++ b/net/proxy/proxy_resolver_perftest.cc @@ -7,7 +7,7 @@ #include "base/file_util.h" #include "base/path_service.h" #include "base/strings/string_util.h" -#include "base/test/perftimer.h" +#include "base/test/perf_time_logger.h" #include "net/base/net_errors.h" #include "net/dns/mock_host_resolver.h" #include "net/proxy/proxy_info.h" @@ -130,7 +130,7 @@ class PacPerfSuiteRunner { // Start the perf timer. std::string perf_test_name = resolver_name_ + "_" + script_name; - PerfTimeLogger timer(perf_test_name.c_str()); + base::PerfTimeLogger timer(perf_test_name.c_str()); for (int i = 0; i < kNumIterations; ++i) { // Round-robin between URLs to resolve. |