blob: 5909feeb15f86eaec871c6b500f3ed8a9a68c8e9 [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2020 The Chromium Authors
Nate Fischer03103b92020-06-05 19:30:502// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
rbpotter422d5eb2025-02-05 16:42:485#ifndef COMPONENTS_WEBUI_FLAGS_FLAGS_UI_METRICS_H_
6#define COMPONENTS_WEBUI_FLAGS_FLAGS_UI_METRICS_H_
Nate Fischer03103b92020-06-05 19:30:507
8#include <set>
9#include <string>
10
11#include "base/metrics/histogram_base.h"
12
13namespace flags_ui {
14
15// Returns the UMA id for the specified switch name.
Ramon Cano Aparicio9d696372025-01-16 17:56:2316base::HistogramBase::Sample32 GetSwitchUMAId(const std::string& switch_name);
Nate Fischer03103b92020-06-05 19:30:5017
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.
21void ReportAboutFlagsHistogram(const std::string& uma_histogram_name,
22 const std::set<std::string>& switches,
23 const std::set<std::string>& features);
24
25namespace testing {
26
27// This value is reported as switch histogram ID if switch name has unknown
28// format.
Ramon Cano Aparicio9d696372025-01-16 17:56:2329extern const base::HistogramBase::Sample32 kBadSwitchFormatHistogramId;
Nate Fischer03103b92020-06-05 19:30:5030
31} // namespace testing
32
33} // namespace flags_ui
34
rbpotter422d5eb2025-02-05 16:42:4835#endif // COMPONENTS_WEBUI_FLAGS_FLAGS_UI_METRICS_H_