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

Side by Side Diff: components/download/internal/stats.h

Issue 2895953004: Add initial Controller to DownloadService (Closed)
Patch Set: Rebased Created 3 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 unified diff | Download patch
« no previous file with comments | « components/download/internal/startup_status.cc ('k') | components/download/internal/stats.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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 COMPONENTS_DOWNLOAD_INTERNAL_STATS_H_
6 #define COMPONENTS_DOWNLOAD_INTERNAL_STATS_H_
7
8 #include "components/download/public/clients.h"
9 #include "components/download/public/download_params.h"
10
11 namespace download {
12
13 struct StartupStatus;
14
15 namespace stats {
16
17 // Please follow the following rules for all enums:
18 // 1. Keep them in sync with the corresponding entry in enums.xml.
19 // 2. Treat them as append only.
20 // 3. Do not remove any enums. Only mark them as deprecated.
21
22 // Enum used by UMA metrics to track which actions a Client is taking on the
23 // service.
24 enum class ServiceApiAction {
25 // Represents a call to DownloadService::StartDownload.
26 START_DOWNLOAD = 0,
27
28 // Represents a call to DownloadService::PauseDownload.
29 PAUSE_DOWNLOAD = 1,
30
31 // Represents a call to DownloadService::ResumeDownload.
32 RESUME_DOWNLOAD = 2,
33
34 // Represents a call to DownloadService::CancelDownload.
35 CANCEL_DOWNLOAD = 3,
36
37 // Represents a call to DownloadService::ChangeCriteria.
38 CHANGE_CRITERIA = 4,
39
40 // The last entry for the enum.
41 COUNT = 5,
42 };
43
44 // Enum used by UMA metrics to tie to specific actions taken on a Model. This
45 // can be used to track failure events.
46 enum class ModelAction {
47 // Represents an attempt to initialize the Model.
48 INITIALIZE = 0,
49
50 // Represents an attempt to add an Entry to the Model.
51 ADD = 1,
52
53 // Represents an attempt to update an Entry in the Model.
54 UPDATE = 2,
55
56 // Represents an attempt to remove an Entry from the Model.
57 REMOVE = 3,
58
59 // The last entry for the enum.
60 COUNT = 4,
61 };
62
63 // Logs the results of starting up the Controller. Will log each failure reason
64 // if |status| contains more than one initialization failure.
65 void LogControllerStartupStatus(const StartupStatus& status);
66
67 // Logs an action taken on the service API.
68 void LogServiceApiAction(DownloadClient client, ServiceApiAction action);
69
70 // Logs the result of a StartDownload() attempt on the service.
71 void LogStartDownloadResult(DownloadClient client,
72 DownloadParams::StartResult result);
73
74 // Logs statistics about the result of a Model operation. Used to track failure
75 // cases.
76 void LogModelOperationResult(ModelAction action, bool success);
77
78 } // namespace stats
79 } // namespace download
80
81 #endif // COMPONENTS_DOWNLOAD_INTERNAL_STATS_H_
OLDNEW
« no previous file with comments | « components/download/internal/startup_status.cc ('k') | components/download/internal/stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698