summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-19 20:35:32 +0000
committerpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-19 20:35:32 +0000
commit90766c3494b8042ef8ff99b8527a40bdd9d212f2 (patch)
treea899bacfedc892e2c42c5d3267f69987dd917074 /chrome/test
parent67493619b9b39485367ecab80bff6c934a9bcf4e (diff)
downloadchromium_src-90766c3494b8042ef8ff99b8527a40bdd9d212f2.zip
chromium_src-90766c3494b8042ef8ff99b8527a40bdd9d212f2.tar.gz
chromium_src-90766c3494b8042ef8ff99b8527a40bdd9d212f2.tar.bz2
Add a new PrintResult() method that outputs perf-test results in a particular
arcane format expected by the Python post-processing script. Switch memory_test to use that method. Fix a small typo in the vcproj group name. BUG=1326725,1221588 TEST=none yet; will be covered by buildbot git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/memory_test/memory_test.cc81
-rw-r--r--chrome/test/memory_test/memory_test.vcproj2
-rw-r--r--chrome/test/ui/ui_test.cc13
-rw-r--r--chrome/test/ui/ui_test.h20
4 files changed, 81 insertions, 35 deletions
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index 6b9754b..d025dae 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -250,7 +250,11 @@ class MemoryTest : public UITest {
void PrintResults(const wchar_t* test_name, size_t commit_size) {
PrintMemoryUsageInfo(test_name);
- wprintf(L"%ls_commit_charge_kb = %d\n", test_name, commit_size / 1024);
+ std::wstring trace_name(test_name);
+ trace_name.append(L"_cc");
+
+ PrintResult(L"commit_charge", L"", trace_name,
+ commit_size / 1024, L"kb", true /* important */);
}
void PrintIOPerfInfo(const wchar_t* test_name) {
@@ -278,28 +282,29 @@ class MemoryTest : public UITest {
ZeroMemory(&io_counters, sizeof(io_counters));
if (process_metrics.get()->GetIOCounters(&io_counters)) {
- wchar_t* browser_name = L"browser";
- wchar_t* render_name = L"render";
- wchar_t* chrome_name;
- if (pid == chrome_filter.browser_process_id()) {
- chrome_name = browser_name;
- } else {
- chrome_name = render_name;
- }
+ std::wstring chrome_name =
+ (pid == chrome_filter.browser_process_id()) ? L"_b" : L"_r";
- // print out IO performance
- wprintf(L"%ls_%ls_read_op = %d\n",
- test_name, chrome_name, io_counters.ReadOperationCount);
- wprintf(L"%ls_%ls_write_op = %d\n",
- test_name, chrome_name, io_counters.WriteOperationCount);
- wprintf(L"%ls_%ls_other_op = %d\n",
- test_name, chrome_name, io_counters.OtherOperationCount);
- wprintf(L"%ls_%ls_read_byte = %d K\n",
- test_name, chrome_name, io_counters.ReadTransferCount / 1024);
- wprintf(L"%ls_%ls_write_byte = %d K\n",
- test_name, chrome_name, io_counters.WriteTransferCount / 1024);
- wprintf(L"%ls_%ls_other_byte = %d K\n",
- test_name, chrome_name, io_counters.OtherTransferCount / 1024);
+ // Print out IO performance. We assume that the values can be
+ // converted to size_t (they're reported as ULONGLONG, 64-bit numbers).
+ PrintResult(L"read_op", chrome_name, test_name + chrome_name,
+ static_cast<size_t>(io_counters.ReadOperationCount), L"",
+ false /* not important */);
+ PrintResult(L"write_op", chrome_name, test_name + chrome_name,
+ static_cast<size_t>(io_counters.WriteOperationCount), L"",
+ false /* not important */);
+ PrintResult(L"other_op", chrome_name, test_name + chrome_name,
+ static_cast<size_t>(io_counters.OtherOperationCount), L"",
+ false /* not important */);
+ PrintResult(L"read_byte", chrome_name, test_name + chrome_name,
+ static_cast<size_t>(io_counters.ReadTransferCount / 1024),
+ L"kb", false /* not important */);
+ PrintResult(L"write_byte", chrome_name, test_name + chrome_name,
+ static_cast<size_t>(io_counters.WriteTransferCount / 1024),
+ L"kb", false /* not important */);
+ PrintResult(L"other_byte", chrome_name, test_name + chrome_name,
+ static_cast<size_t>(io_counters.OtherTransferCount / 1024),
+ L"kb", false /* not important */);
}
}
}
@@ -334,15 +339,23 @@ class MemoryTest : public UITest {
num_chrome_processes++;
}
}
- wprintf(L"%ls_browser_vm_final_kb = %d\n", test_name,
- browser_virtual_size / 1024);
- wprintf(L"%ls_browser_ws_final_kb = %d\n", test_name,
- browser_working_set_size / 1024);
- wprintf(L"%ls_memory_vm_final_kb = %d\n", test_name,
- virtual_size / 1024);
- wprintf(L"%ls_memory_ws_final_kb = %d\n", test_name,
- working_set_size / 1024);
- wprintf(L"%ls_processes = %d\n", test_name, num_chrome_processes);
+
+ std::wstring trace_name(test_name);
+ PrintResult(L"vm_final_browser", L"", trace_name + L"_vm_b",
+ browser_virtual_size / 1024, L"kb",
+ false /* not important */);
+ PrintResult(L"ws_final_browser", L"", trace_name + L"_ws_b",
+ browser_working_set_size / 1024, L"kb",
+ false /* not important */);
+ PrintResult(L"vm_final_total", L"", trace_name + L"_vm",
+ virtual_size / 1024, L"kb",
+ false /* not important */);
+ PrintResult(L"ws_final_total", L"", trace_name + L"_ws",
+ working_set_size / 1024, L"kb",
+ true /* important */);
+ PrintResult(L"processes", L"", trace_name + L"_proc",
+ num_chrome_processes, L"",
+ false /* not important */);
}
private:
@@ -371,13 +384,13 @@ class MemoryReferenceTest : public MemoryTest {
} // namespace
TEST_F(MemoryTest, SingleTabTest) {
- RunTest(L"OneTabTest", 1);
+ RunTest(L"1t", 1);
}
TEST_F(MemoryTest, FiveTabTest) {
- RunTest(L"FiveTabTest", 5);
+ RunTest(L"5t", 5);
}
TEST_F(MemoryTest, TwelveTabTest) {
- RunTest(L"TwelveTabTest", 12);
+ RunTest(L"12t", 12);
}
diff --git a/chrome/test/memory_test/memory_test.vcproj b/chrome/test/memory_test/memory_test.vcproj
index 50a20c5..75efd21 100644
--- a/chrome/test/memory_test/memory_test.vcproj
+++ b/chrome/test/memory_test/memory_test.vcproj
@@ -201,7 +201,7 @@
</File>
</Filter>
<Filter
- Name="TestMemeory"
+ Name="TestMemory"
>
<File
RelativePath=".\memory_test.cc"
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index 439846f..7160f15 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -557,3 +557,16 @@ bool UITest::CloseBrowser(BrowserProxy* browser,
delete response;
return result;
}
+
+void UITest::PrintResult(const std::wstring& measurement,
+ const std::wstring& modifier,
+ const std::wstring& trace,
+ size_t value,
+ const std::wstring& units,
+ bool important) {
+ wprintf(L"%lsRESULT %ls%ls: %ls= %d %ls\n",
+ important ? L"*" : L"", measurement.c_str(), modifier.c_str(),
+ trace.c_str(), value, units.c_str());
+}
+
+
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index b4cf324..cd9ede9 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -154,6 +154,26 @@ class UITest : public testing::Test {
// after the browser process has terminated.
bool CloseBrowser(BrowserProxy* browser, bool* application_closed) const;
+ // Prints numerical information to stdout in a controlled format, for
+ // post-processing. |measurement| is a description of the quantity being
+ // measured, e.g. "vm_peak"; |modifier| is provided as a convenience and
+ // will be appended directly to the name of the |measurement|, e.g.
+ // "_browser"; |trace| is a description of the particular data point, e.g.
+ // "reference"; |value| is the measured value; and |units| is a description
+ // of the units of measure, e.g. "bytes". If |important| is true, the output
+ // line will be specially marked, to notify the post-processor. The strings
+ // may be empty. They should not contain any colons (:) or equals signs (=).
+ // A typical post-processing step would be to produce graphs of the data
+ // produced for various builds, using the combined |measurement| + |modifier|
+ // string to specify a particular graph and the |trace| to identify a trace
+ // (i.e., data series) on that graph.
+ void PrintResult(const std::wstring& measurement,
+ const std::wstring& modifier,
+ const std::wstring& trace,
+ size_t value,
+ const std::wstring& units,
+ bool important);
+
// Gets the directory for the currently active profile in the browser.
std::wstring GetDownloadDirectory();