blob: 792a32f0295c77f6e2927140d916c9de94676f6a [file] [log] [blame]
Nate Fischer03103b92020-06-05 19:30:501// 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
13namespace flags_ui {
14
15// Returns the UMA id for the specified switch name.
16base::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.
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.
29extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId;
30
31} // namespace testing
32
33} // namespace flags_ui
34
35#endif // COMPONENTS_FLAGS_UI_FLAGS_UI_WITCHES_H_