Nate Fischer | 03103b9 | 2020-06-05 19:30:50 | [diff] [blame^] | 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 COMPONENTS_FLAGS_UI_FLAGS_UI_METRICS_H_ |
| 6 | #define COMPONENTS_FLAGS_UI_FLAGS_UI_METRICS_H_ |
| 7 | |
| 8 | #include <set> |
| 9 | #include <string> |
| 10 | |
| 11 | #include "base/metrics/histogram_base.h" |
| 12 | |
| 13 | namespace flags_ui { |
| 14 | |
| 15 | // Returns the UMA id for the specified switch name. |
| 16 | base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name); |
| 17 | |
| 18 | // Sends stats (as UMA histogram) about a set of command line |flags| in |
| 19 | // a histogram, with an enum value for each flag in |switches| and |features|, |
| 20 | // based on the hash of the flag name. |
| 21 | void ReportAboutFlagsHistogram(const std::string& uma_histogram_name, |
| 22 | const std::set<std::string>& switches, |
| 23 | const std::set<std::string>& features); |
| 24 | |
| 25 | namespace testing { |
| 26 | |
| 27 | // This value is reported as switch histogram ID if switch name has unknown |
| 28 | // format. |
| 29 | extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId; |
| 30 | |
| 31 | } // namespace testing |
| 32 | |
| 33 | } // namespace flags_ui |
| 34 | |
| 35 | #endif // COMPONENTS_FLAGS_UI_FLAGS_UI_WITCHES_H_ |