Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
Nate Fischer | 03103b9 | 2020-06-05 19:30:50 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
rbpotter | 422d5eb | 2025-02-05 16:42:48 | [diff] [blame] | 5 | #ifndef COMPONENTS_WEBUI_FLAGS_FLAGS_UI_METRICS_H_ |
| 6 | #define COMPONENTS_WEBUI_FLAGS_FLAGS_UI_METRICS_H_ |
Nate Fischer | 03103b9 | 2020-06-05 19:30:50 | [diff] [blame] | 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. |
Ramon Cano Aparicio | 9d69637 | 2025-01-16 17:56:23 | [diff] [blame] | 16 | base::HistogramBase::Sample32 GetSwitchUMAId(const std::string& switch_name); |
Nate Fischer | 03103b9 | 2020-06-05 19:30:50 | [diff] [blame] | 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. |
Ramon Cano Aparicio | 9d69637 | 2025-01-16 17:56:23 | [diff] [blame] | 29 | extern const base::HistogramBase::Sample32 kBadSwitchFormatHistogramId; |
Nate Fischer | 03103b9 | 2020-06-05 19:30:50 | [diff] [blame] | 30 | |
| 31 | } // namespace testing |
| 32 | |
| 33 | } // namespace flags_ui |
| 34 | |
rbpotter | 422d5eb | 2025-02-05 16:42:48 | [diff] [blame] | 35 | #endif // COMPONENTS_WEBUI_FLAGS_FLAGS_UI_METRICS_H_ |