counts.cc 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright 2015 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. #include "components/profile_metrics/counts.h"
  5. #include "base/metrics/histogram_macros.h"
  6. namespace profile_metrics {
  7. void LogProfileMetricsCounts(const Counts& counts) {
  8. UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfiles", counts.total);
  9. // Ignore other metrics if we have no profiles.
  10. if (counts.total > 0) {
  11. UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfManagedProfiles",
  12. counts.supervised);
  13. UMA_HISTOGRAM_COUNTS_100("Profile.PercentageOfManagedProfiles",
  14. 100 * counts.supervised / counts.total);
  15. UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfiles",
  16. counts.signedin);
  17. UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfActiveProfiles", counts.active);
  18. UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfUnusedProfiles", counts.unused);
  19. UMA_HISTOGRAM_ENUMERATION("Profile.ColorsUniqueness",
  20. counts.colors_uniqueness);
  21. }
  22. }
  23. } // namespace profile_metrics