blob: ad1ba4e17ad1699f95893c2b2f5504fc8c0b4656 [file] [log] [blame]
Ben Chancb3563e2013-09-12 23:20:34 -07001// 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
9namespace mist {
10
11namespace {
12
13enum SwitchResult {
14 kSwitchResultSuccess,
15 kSwitchResultFailure,
16 kSwitchResultMaxValue
17};
18
19} // namespace
20
21Metrics::Metrics() {
22 metrics_library_.Init();
23}
24
Ben Chancb3563e2013-09-12 23:20:34 -070025void 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