blob: a2bd4637a5477ec4d6604c4db9ef3ef526d3719e [file] [log] [blame]
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mist/metrics.h"
#include <base/logging.h>
namespace mist {
namespace {
enum SwitchResult {
kSwitchResultSuccess,
kSwitchResultFailure,
kSwitchResultMaxValue
};
} // namespace
Metrics::Metrics() {
metrics_library_.Init();
}
Metrics::~Metrics() {}
void Metrics::RecordSwitchResult(bool success) {
if (!metrics_library_.SendEnumToUMA(
"Mist.SwitchResult",
success ? kSwitchResultSuccess : kSwitchResultFailure,
kSwitchResultMaxValue))
LOG(WARNING) << "Could not send switch result sample to UMA.";
}
} // namespace mist