Ben Chan | cb3563e | 2013-09-12 23:20:34 -0700 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium OS 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 | #include "mist/metrics.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | |
| 9 | namespace mist { |
| 10 | |
| 11 | namespace { |
| 12 | |
| 13 | enum SwitchResult { |
| 14 | kSwitchResultSuccess, |
| 15 | kSwitchResultFailure, |
| 16 | kSwitchResultMaxValue |
| 17 | }; |
| 18 | |
| 19 | } // namespace |
| 20 | |
| 21 | Metrics::Metrics() { |
| 22 | metrics_library_.Init(); |
| 23 | } |
| 24 | |
Ben Chan | cb3563e | 2013-09-12 23:20:34 -0700 | [diff] [blame] | 25 | void Metrics::RecordSwitchResult(bool success) { |
| 26 | if (!metrics_library_.SendEnumToUMA( |
| 27 | "Mist.SwitchResult", |
| 28 | success ? kSwitchResultSuccess : kSwitchResultFailure, |
| 29 | kSwitchResultMaxValue)) |
| 30 | LOG(WARNING) << "Could not send switch result sample to UMA."; |
| 31 | } |
| 32 | |
| 33 | } // namespace mist |