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

Unified Diff: chrome/browser/metrics/perf/perf_provider_chromeos.h

Issue 1395273002: PerfProvider: Run a randomly selected perf command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@collection_params
Patch Set: Address comments on PS2 Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/metrics/perf/perf_provider_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/perf/perf_provider_chromeos.h
diff --git a/chrome/browser/metrics/perf/perf_provider_chromeos.h b/chrome/browser/metrics/perf/perf_provider_chromeos.h
index 0456516516be5d9ee48f1bbec96a3c9feb32d4ad..708ef4c971e9582570cbc9deb09c65717e8cc7b9 100644
--- a/chrome/browser/metrics/perf/perf_provider_chromeos.h
+++ b/chrome/browser/metrics/perf/perf_provider_chromeos.h
@@ -12,6 +12,8 @@
#include "base/threading/non_thread_safe.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "chrome/browser/metrics/perf/cpu_identity.h"
+#include "chrome/browser/metrics/perf/random_selector.h"
#include "chrome/browser/sessions/session_restore.h"
#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/login/login_state.h"
@@ -194,6 +196,9 @@ class PerfProvider : public base::NonThreadSafe,
// Parameters controlling how profiles are collected.
CollectionParams collection_params_;
+ // Set of commands to choose from.
+ RandomSelector command_selector_;
+
// Vector of SampledProfile protobufs containing perf profiles.
std::vector<SampledProfile> cached_perf_data_;
@@ -226,6 +231,16 @@ class PerfProvider : public base::NonThreadSafe,
DISALLOW_COPY_AND_ASSIGN(PerfProvider);
};
+// Exposed for unit testing.
+namespace internal {
+
+// Return the default set of perf commands and their odds of selection given
+// the identity of the CPU in |cpuid|.
+std::vector<RandomSelector::WeightAndValue> GetDefaultCommandsForCpu(
+ const CPUIdentity& cpuid);
+
+} // namespace internal
+
} // namespace metrics
#endif // CHROME_BROWSER_METRICS_PERF_PERF_PROVIDER_CHROMEOS_H_
« no previous file with comments | « no previous file | chrome/browser/metrics/perf/perf_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698