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

Side by Side Diff: chrome/browser/metrics/disk_metrics_provider.h

Issue 999623002: metrics/base: log whether drives have seek penalties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_METRICS_DISK_METRICS_PROVIDER_H_
Alexei Svitkine (slow) 2015/03/12 16:41:06 Can this class live in the component? Since it jus
Dan Beam 2015/03/13 19:31:32 look at the cc dependencies
6 #define CHROME_BROWSER_METRICS_DISK_METRICS_PROVIDER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "components/metrics/metrics_provider.h"
12
13 struct SeekPenaltyResponse {
14 SeekPenaltyResponse();
15 bool success;
16 bool has_seek_penalty;
17 };
18
19 struct DiskMetrics {
Alexei Svitkine (slow) 2015/03/12 16:41:06 Can these be declared inside the class? That way,
Dan Beam 2015/03/13 19:31:32 yes, Done.
20 SeekPenaltyResponse app_disk;
21 SeekPenaltyResponse user_data_disk;
22 };
23
24 // Provides metrics about the local disks on a user's computer. Currently only
25 // checks to see if they incur a seek-time penalty (e.g. if they're SSDs).
26 class DiskMetricsProvider : public metrics::MetricsProvider {
27 public:
28 DiskMetricsProvider();
29 ~DiskMetricsProvider() override;
30
31 // metrics::MetricsDataProvider:
32 void ProvideSystemProfileMetrics(
33 metrics::SystemProfileProto* system_profile_proto) override;
34
35 private:
36 void GotDiskMetrics(const DiskMetrics& metrics);
Alexei Svitkine (slow) 2015/03/12 16:41:06 Add a comment.
Dan Beam 2015/03/13 19:31:32 Done.
37
38 DiskMetrics metrics_;
39
40 base::ThreadChecker thread_checker_;
41 base::WeakPtrFactory<DiskMetricsProvider> weak_ptr_factory_;
42
43 DISALLOW_COPY_AND_ASSIGN(DiskMetricsProvider);
44 };
45
46 #endif // CHROME_BROWSER_METRICS_DISK_METRICS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698