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

Unified Diff: content/browser/power_profiler/power_data_provider_ia_win.cc

Issue 309803002: [PowerProfiler] Power Profiler service should detect the sampling rate from the data provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/power_profiler/power_data_provider_ia_win.cc
diff --git a/content/browser/power_profiler/power_data_provider_ia_win.cc b/content/browser/power_profiler/power_data_provider_ia_win.cc
index 597e3bd73ac53730372ab386ee9e3e6db6ede4c3..2127ae299734b293b6a68b5c08e33b7f77475f00 100644
--- a/content/browser/power_profiler/power_data_provider_ia_win.cc
+++ b/content/browser/power_profiler/power_data_provider_ia_win.cc
@@ -4,10 +4,16 @@
#include "content/browser/power_profiler/power_data_provider_ia_win.h"
+#include "base/basictypes.h"
#include "base/logging.h"
namespace content {
+// Default sampling period, as recommended by Intel Power Gadget.
+// Section 3.1 of
+// http://software.intel.com/en-us/blogs/2013/10/03/using-the-intel-power-gadget-api-on-windows
+const int kDefaultSamplePeriodMs = 50;
+
scoped_ptr<PowerDataProvider> PowerDataProvider::Create() {
scoped_ptr<PowerDataProviderIA> provider(new PowerDataProviderIA());
if (provider->Initialize())
@@ -54,6 +60,10 @@ PowerEventVector PowerDataProviderIA::GetData() {
return events;
}
+base::TimeDelta PowerDataProviderIA::GetSamplingRate() {
+ return base::TimeDelta::FromMilliseconds(kDefaultSamplePeriodMs);
+}
+
bool PowerDataProviderIA::Initialize() {
if (is_open_)
return true;
« no previous file with comments | « content/browser/power_profiler/power_data_provider_ia_win.h ('k') | content/browser/power_profiler/power_profiler_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698