1 // Copyright 2020 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_CHROMEOS_POWER_ML_SMART_DIM_METRICS_H_
6 #define CHROME_BROWSER_CHROMEOS_POWER_ML_SMART_DIM_METRICS_H_
7 
8 namespace chromeos {
9 namespace power {
10 namespace ml {
11 
12 // These values are persisted to logs. Entries should not be renumbered and
13 // numeric values should never be reused.
14 
15 enum class SmartDimModelResult {
16   kSuccess = 0,
17   kPreprocessorInitializationFailed = 1,
18   kPreprocessorOtherError = 2,
19   kOtherError = 3,
20   kMismatchedFeatureSizeError = 4,
21   kMlServiceInitializationFailedError = 5,
22   kMaxValue = kMlServiceInitializationFailedError
23 };
24 
25 enum class SmartDimParameterResult {
26   kSuccess = 0,
27   kUndefinedError = 1,
28   kParsingError = 2,
29   kUseDefaultValue = 3,
30   kMaxValue = kUseDefaultValue
31 };
32 
33 enum class LoadComponentEvent {
34   kSuccess = 0,
35   kReadComponentFilesError = 1,
36   kLoadPreprocessorError = 2,
37   kLoadMetadataError = 3,
38   kLoadModelError = 4,
39   kCreateGraphExecutorError = 5,
40   kMaxValue = kCreateGraphExecutorError
41 };
42 
43 enum class WorkerType {
44   kBuiltinWorker = 0,
45   kDownloadWorker = 1,
46   kMaxValue = kDownloadWorker
47 };
48 
49 enum class ComponentVersionType {
50   kDefault = 0,
51   kExperimental = 1,
52   kEmpty = 2,
53   kMaxValue = kEmpty
54 };
55 
56 void LogPowerMLSmartDimModelResult(SmartDimModelResult result);
57 
58 void LogPowerMLSmartDimParameterResult(SmartDimParameterResult result);
59 
60 void LogComponentVersionType(ComponentVersionType type);
61 
62 void LogWorkerType(WorkerType type);
63 
64 void LogLoadComponentEvent(LoadComponentEvent event);
65 
66 }  // namespace ml
67 }  // namespace power
68 }  // namespace chromeos
69 
70 #endif  // CHROME_BROWSER_CHROMEOS_POWER_ML_SMART_DIM_METRICS_H_
71