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

Side by Side Diff: chrome/browser/task_manager/sampling/task_group.h

Issue 2573183002: Add process start time and CPU time columns to task manager (Closed)
Patch Set: Add TODO comment for a bug, which will be addressed in another CL. 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_TASK_MANAGER_SAMPLING_TASK_GROUP_H_ 5 #ifndef CHROME_BROWSER_TASK_MANAGER_SAMPLING_TASK_GROUP_H_
6 #define CHROME_BROWSER_TASK_MANAGER_SAMPLING_TASK_GROUP_H_ 6 #define CHROME_BROWSER_TASK_MANAGER_SAMPLING_TASK_GROUP_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 bool AreBackgroundCalculationsDone() const; 60 bool AreBackgroundCalculationsDone() const;
61 61
62 const base::ProcessHandle& process_handle() const { return process_handle_; } 62 const base::ProcessHandle& process_handle() const { return process_handle_; }
63 const base::ProcessId& process_id() const { return process_id_; } 63 const base::ProcessId& process_id() const { return process_id_; }
64 64
65 const std::vector<Task*>& tasks() const { return tasks_; } 65 const std::vector<Task*>& tasks() const { return tasks_; }
66 size_t num_tasks() const { return tasks().size(); } 66 size_t num_tasks() const { return tasks().size(); }
67 bool empty() const { return tasks().empty(); } 67 bool empty() const { return tasks().empty(); }
68 68
69 double cpu_usage() const { return cpu_usage_; } 69 double cpu_usage() const { return cpu_usage_; }
70 uint64_t start_time() const { return start_time_; }
71 uint64_t cpu_time() const { return cpu_time_; }
70 int64_t private_bytes() const { return memory_usage_.private_bytes; } 72 int64_t private_bytes() const { return memory_usage_.private_bytes; }
71 int64_t shared_bytes() const { return memory_usage_.shared_bytes; } 73 int64_t shared_bytes() const { return memory_usage_.shared_bytes; }
72 int64_t physical_bytes() const { return memory_usage_.physical_bytes; } 74 int64_t physical_bytes() const { return memory_usage_.physical_bytes; }
73 #if defined(OS_CHROMEOS) 75 #if defined(OS_CHROMEOS)
74 int64_t swapped_bytes() const { return memory_usage_.swapped_bytes; } 76 int64_t swapped_bytes() const { return memory_usage_.swapped_bytes; }
75 #endif 77 #endif
76 int64_t gpu_memory() const { return gpu_memory_; } 78 int64_t gpu_memory() const { return gpu_memory_; }
77 bool gpu_memory_has_duplicates() const { return gpu_memory_has_duplicates_; } 79 bool gpu_memory_has_duplicates() const { return gpu_memory_has_duplicates_; }
78 int64_t per_process_network_usage() const { 80 int64_t per_process_network_usage() const {
79 return per_process_network_usage_; 81 return per_process_network_usage_;
(...skipping 20 matching lines...) Expand all
100 private: 102 private:
101 void RefreshGpuMemory(const gpu::VideoMemoryUsageStats& gpu_memory_stats); 103 void RefreshGpuMemory(const gpu::VideoMemoryUsageStats& gpu_memory_stats);
102 104
103 void RefreshWindowsHandles(); 105 void RefreshWindowsHandles();
104 106
105 // |child_process_unique_id| see Task::GetChildProcessUniqueID(). 107 // |child_process_unique_id| see Task::GetChildProcessUniqueID().
106 void RefreshNaClDebugStubPort(int child_process_unique_id); 108 void RefreshNaClDebugStubPort(int child_process_unique_id);
107 109
108 void OnCpuRefreshDone(double cpu_usage); 110 void OnCpuRefreshDone(double cpu_usage);
109 111
112 void OnStartTimeRefreshDone(uint64_t start_time);
113
114 void OnCpuTimeRefreshDone(uint64_t cpu_time);
115
110 void OnPhysicalMemoryUsageRefreshDone(int64_t physical_bytes); 116 void OnPhysicalMemoryUsageRefreshDone(int64_t physical_bytes);
111 void OnMemoryUsageRefreshDone(MemoryUsageStats memory_usage); 117 void OnMemoryUsageRefreshDone(MemoryUsageStats memory_usage);
112 118
113 void OnIdleWakeupsRefreshDone(int idle_wakeups_per_second); 119 void OnIdleWakeupsRefreshDone(int idle_wakeups_per_second);
114 120
115 #if defined(OS_LINUX) 121 #if defined(OS_LINUX)
116 void OnOpenFdCountRefreshDone(int open_fd_count); 122 void OnOpenFdCountRefreshDone(int open_fd_count);
117 #endif // defined(OS_LINUX) 123 #endif // defined(OS_LINUX)
118 124
119 void OnProcessPriorityDone(bool is_backgrounded); 125 void OnProcessPriorityDone(bool is_backgrounded);
(...skipping 16 matching lines...) Expand all
136 // Tasks are not owned by the TaskGroup. They're owned by the TaskProviders. 142 // Tasks are not owned by the TaskGroup. They're owned by the TaskProviders.
137 std::vector<Task*> tasks_; 143 std::vector<Task*> tasks_;
138 144
139 // Flags will be used to determine when the background calculations has 145 // Flags will be used to determine when the background calculations has
140 // completed for the enabled refresh types for this TaskGroup. 146 // completed for the enabled refresh types for this TaskGroup.
141 int64_t expected_on_bg_done_flags_; 147 int64_t expected_on_bg_done_flags_;
142 int64_t current_on_bg_done_flags_; 148 int64_t current_on_bg_done_flags_;
143 149
144 // The per process resources usages. 150 // The per process resources usages.
145 double cpu_usage_; 151 double cpu_usage_;
152 uint64_t start_time_;
153 uint64_t cpu_time_;
afakhry 2016/12/21 18:34:34 I think the units need to be documented here as we
chengx 2016/12/21 22:05:54 Done.
146 MemoryUsageStats memory_usage_; 154 MemoryUsageStats memory_usage_;
147 int64_t gpu_memory_; 155 int64_t gpu_memory_;
148 // The network usage in bytes per second as the sum of all network usages of 156 // The network usage in bytes per second as the sum of all network usages of
149 // the individual tasks sharing the same process. 157 // the individual tasks sharing the same process.
150 int64_t per_process_network_usage_; 158 int64_t per_process_network_usage_;
151 #if defined(OS_WIN) 159 #if defined(OS_WIN)
152 // Windows GDI and USER Handles. 160 // Windows GDI and USER Handles.
153 int64_t gdi_current_handles_; 161 int64_t gdi_current_handles_;
154 int64_t gdi_peak_handles_; 162 int64_t gdi_peak_handles_;
155 int64_t user_current_handles_; 163 int64_t user_current_handles_;
(...skipping 13 matching lines...) Expand all
169 // Always keep this the last member of this class so that it's the first to be 177 // Always keep this the last member of this class so that it's the first to be
170 // destroyed. 178 // destroyed.
171 base::WeakPtrFactory<TaskGroup> weak_ptr_factory_; 179 base::WeakPtrFactory<TaskGroup> weak_ptr_factory_;
172 180
173 DISALLOW_COPY_AND_ASSIGN(TaskGroup); 181 DISALLOW_COPY_AND_ASSIGN(TaskGroup);
174 }; 182 };
175 183
176 } // namespace task_manager 184 } // namespace task_manager
177 185
178 #endif // CHROME_BROWSER_TASK_MANAGER_SAMPLING_TASK_GROUP_H_ 186 #endif // CHROME_BROWSER_TASK_MANAGER_SAMPLING_TASK_GROUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698