flags_ui_metrics.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. #ifndef COMPONENTS_FLAGS_UI_FLAGS_UI_METRICS_H_
  5. #define COMPONENTS_FLAGS_UI_FLAGS_UI_METRICS_H_
  6. #include <set>
  7. #include <string>
  8. #include "base/metrics/histogram_base.h"
  9. namespace flags_ui {
  10. // Returns the UMA id for the specified switch name.
  11. base::HistogramBase::Sample GetSwitchUMAId(const std::string& switch_name);
  12. // Sends stats (as UMA histogram) about a set of command line |flags| in
  13. // a histogram, with an enum value for each flag in |switches| and |features|,
  14. // based on the hash of the flag name.
  15. void ReportAboutFlagsHistogram(const std::string& uma_histogram_name,
  16. const std::set<std::string>& switches,
  17. const std::set<std::string>& features);
  18. namespace testing {
  19. // This value is reported as switch histogram ID if switch name has unknown
  20. // format.
  21. extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId;
  22. } // namespace testing
  23. } // namespace flags_ui
  24. #endif // COMPONENTS_FLAGS_UI_FLAGS_UI_METRICS_H_