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

Side by Side Diff: base/process/process_metrics.cc

Issue 2667023004: Add comments explaining Task Manager idle wakeups computation. (Closed)
Patch Set: Add comment about interrupt wakeups vs. idle wakeups. Created 3 years, 10 months 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
« no previous file with comments | « no previous file | base/process/process_metrics_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/process/process_metrics.h" 5 #include "base/process/process_metrics.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if (time_delta == 0) { 79 if (time_delta == 0) {
80 NOTREACHED(); 80 NOTREACHED();
81 return 0; 81 return 0;
82 } 82 }
83 83
84 last_idle_wakeups_time_ = time; 84 last_idle_wakeups_time_ = time;
85 last_absolute_idle_wakeups_ = absolute_idle_wakeups; 85 last_absolute_idle_wakeups_ = absolute_idle_wakeups;
86 86
87 // Round to average wakeups per second. 87 // Round to average wakeups per second.
88 int64_t wakeups_delta_for_ms = wakeups_delta * Time::kMicrosecondsPerSecond; 88 int64_t wakeups_delta_for_ms = wakeups_delta * Time::kMicrosecondsPerSecond;
89 return (wakeups_delta_for_ms + time_delta / 2) / time_delta; 89 return wakeups_delta_for_ms / time_delta;
brucedawson 2017/02/02 00:55:29 This term is presumably (see comment on line 87) t
shrike 2017/02/02 16:12:50 Thank you brucedawson@. I saw the comment about ro
90 } 90 }
91 #else 91 #else
92 int ProcessMetrics::GetIdleWakeupsPerSecond() { 92 int ProcessMetrics::GetIdleWakeupsPerSecond() {
93 NOTIMPLEMENTED(); // http://crbug.com/120488 93 NOTIMPLEMENTED(); // http://crbug.com/120488
94 return 0; 94 return 0;
95 } 95 }
96 #endif // defined(OS_MACOSX) || defined(OS_LINUX) 96 #endif // defined(OS_MACOSX) || defined(OS_LINUX)
97 97
98 } // namespace base 98 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/process/process_metrics_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698