Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: chrome/browser/task_profiler/task_profiler_data_serializer_unittest.cc

Issue 2386123003: Add heap allocator usage to task profiler. (Closed)
Patch Set: Address Eric's comment. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/process/process_handle.h" 8 #include "base/process/process_handle.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/tracked_objects.h" 10 #include "base/tracked_objects.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Add a snapshot. 66 // Add a snapshot.
67 process_data_phase.tasks.push_back(tracked_objects::TaskSnapshot()); 67 process_data_phase.tasks.push_back(tracked_objects::TaskSnapshot());
68 process_data_phase.tasks.back().birth = parent; 68 process_data_phase.tasks.back().birth = parent;
69 process_data_phase.tasks.back().death_data.count = 37; 69 process_data_phase.tasks.back().death_data.count = 37;
70 process_data_phase.tasks.back().death_data.run_duration_max = 5; 70 process_data_phase.tasks.back().death_data.run_duration_max = 5;
71 process_data_phase.tasks.back().death_data.run_duration_sample = 3; 71 process_data_phase.tasks.back().death_data.run_duration_sample = 3;
72 process_data_phase.tasks.back().death_data.run_duration_sum = 17; 72 process_data_phase.tasks.back().death_data.run_duration_sum = 17;
73 process_data_phase.tasks.back().death_data.queue_duration_max = 53; 73 process_data_phase.tasks.back().death_data.queue_duration_max = 53;
74 process_data_phase.tasks.back().death_data.queue_duration_sample = 13; 74 process_data_phase.tasks.back().death_data.queue_duration_sample = 13;
75 process_data_phase.tasks.back().death_data.queue_duration_sum = 79; 75 process_data_phase.tasks.back().death_data.queue_duration_sum = 79;
76 process_data_phase.tasks.back().death_data.alloc_ops = 127;
77 process_data_phase.tasks.back().death_data.free_ops = 120;
78 process_data_phase.tasks.back().death_data.allocated_bytes = 2013;
79 process_data_phase.tasks.back().death_data.freed_bytes = 1092;
80 process_data_phase.tasks.back().death_data.alloc_overhead_bytes = 201;
81 process_data_phase.tasks.back().death_data.max_allocated_bytes = 1500;
76 process_data_phase.tasks.back().death_thread_name = 82 process_data_phase.tasks.back().death_thread_name =
77 "WorkerPool/-1340960768"; 83 "WorkerPool/-1340960768";
78 84
79 // Add a second snapshot. 85 // Add a second snapshot.
80 process_data_phase.tasks.push_back(tracked_objects::TaskSnapshot()); 86 process_data_phase.tasks.push_back(tracked_objects::TaskSnapshot());
81 process_data_phase.tasks.back().birth = child; 87 process_data_phase.tasks.back().birth = child;
82 process_data_phase.tasks.back().death_data.count = 41; 88 process_data_phase.tasks.back().death_data.count = 41;
83 process_data_phase.tasks.back().death_data.run_duration_max = 205; 89 process_data_phase.tasks.back().death_data.run_duration_max = 205;
84 process_data_phase.tasks.back().death_data.run_duration_sample = 203; 90 process_data_phase.tasks.back().death_data.run_duration_sample = 203;
85 process_data_phase.tasks.back().death_data.run_duration_sum = 2017; 91 process_data_phase.tasks.back().death_data.run_duration_sum = 2017;
86 process_data_phase.tasks.back().death_data.queue_duration_max = 2053; 92 process_data_phase.tasks.back().death_data.queue_duration_max = 2053;
87 process_data_phase.tasks.back().death_data.queue_duration_sample = 2013; 93 process_data_phase.tasks.back().death_data.queue_duration_sample = 2013;
88 process_data_phase.tasks.back().death_data.queue_duration_sum = 2079; 94 process_data_phase.tasks.back().death_data.queue_duration_sum = 2079;
95 process_data_phase.tasks.back().death_data.alloc_ops = 1207;
96 process_data_phase.tasks.back().death_data.free_ops = 1200;
97 process_data_phase.tasks.back().death_data.allocated_bytes = 20013;
98 process_data_phase.tasks.back().death_data.freed_bytes = 10092;
99 process_data_phase.tasks.back().death_data.alloc_overhead_bytes = 2001;
100 process_data_phase.tasks.back().death_data.max_allocated_bytes = 15000;
89 process_data_phase.tasks.back().death_thread_name = "PAC thread #3"; 101 process_data_phase.tasks.back().death_thread_name = "PAC thread #3";
90 102
91 ExpectSerialization(process_data_phase, 239, 103 ExpectSerialization(process_data_phase, 239,
92 metrics::ProfilerEventProto::TrackedObject::RENDERER, 104 metrics::ProfilerEventProto::TrackedObject::RENDERER,
93 "{" 105 "{"
94 "\"list\":[{" 106 "\"list\":[{"
95 "\"birth_location\":{" 107 "\"birth_location\":{"
96 "\"file_name\":\"path/to/foo.cc\"," 108 "\"file_name\":\"path/to/foo.cc\","
97 "\"function_name\":\"WhizBang\"," 109 "\"function_name\":\"WhizBang\","
98 "\"line_number\":101" 110 "\"line_number\":101"
99 "}," 111 "},"
100 "\"birth_thread\":\"CrBrowserMain\"," 112 "\"birth_thread\":\"CrBrowserMain\","
101 "\"death_data\":{" 113 "\"death_data\":{"
114 "\"alloc_ops\":127,"
115 "\"alloc_overhead_bytes\":201,"
116 "\"allocated_bytes\":2013,"
102 "\"count\":37," 117 "\"count\":37,"
118 "\"free_ops\":120,"
119 "\"freed_bytes\":1092,"
120 "\"max_allocated_bytes\":1500,"
103 "\"queue_ms\":79," 121 "\"queue_ms\":79,"
104 "\"queue_ms_max\":53," 122 "\"queue_ms_max\":53,"
105 "\"queue_ms_sample\":13," 123 "\"queue_ms_sample\":13,"
106 "\"run_ms\":17," 124 "\"run_ms\":17,"
107 "\"run_ms_max\":5," 125 "\"run_ms_max\":5,"
108 "\"run_ms_sample\":3" 126 "\"run_ms_sample\":3"
109 "}," 127 "},"
110 "\"death_thread\":\"WorkerPool/-1340960768\"" 128 "\"death_thread\":\"WorkerPool/-1340960768\""
111 "},{" 129 "},{"
112 "\"birth_location\":{" 130 "\"birth_location\":{"
113 "\"file_name\":\"path/to/bar.cc\"," 131 "\"file_name\":\"path/to/bar.cc\","
114 "\"function_name\":\"FizzBoom\"," 132 "\"function_name\":\"FizzBoom\","
115 "\"line_number\":433" 133 "\"line_number\":433"
116 "}," 134 "},"
117 "\"birth_thread\":\"Chrome_IOThread\"," 135 "\"birth_thread\":\"Chrome_IOThread\","
118 "\"death_data\":{" 136 "\"death_data\":{"
137 "\"alloc_ops\":1207,"
138 "\"alloc_overhead_bytes\":2001,"
139 "\"allocated_bytes\":20013,"
119 "\"count\":41," 140 "\"count\":41,"
141 "\"free_ops\":1200,"
142 "\"freed_bytes\":10092,"
143 "\"max_allocated_bytes\":15000,"
120 "\"queue_ms\":2079," 144 "\"queue_ms\":2079,"
121 "\"queue_ms_max\":2053," 145 "\"queue_ms_max\":2053,"
122 "\"queue_ms_sample\":2013," 146 "\"queue_ms_sample\":2013,"
123 "\"run_ms\":2017," 147 "\"run_ms\":2017,"
124 "\"run_ms_max\":205," 148 "\"run_ms_max\":205,"
125 "\"run_ms_sample\":203" 149 "\"run_ms_sample\":203"
126 "}," 150 "},"
127 "\"death_thread\":\"PAC thread #3\"" 151 "\"death_thread\":\"PAC thread #3\""
128 "}]," 152 "}],"
129 "\"process_id\":239," 153 "\"process_id\":239,"
130 "\"process_type\":\"Tab\"" 154 "\"process_type\":\"Tab\""
131 "}"); 155 "}");
132 } 156 }
133 } 157 }
OLDNEW
« no previous file with comments | « chrome/browser/task_profiler/task_profiler_data_serializer.cc ('k') | chrome/browser/ui/webui/profiler_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698