Skip to content

Commit

Permalink
Create list of Constellation only metrics, add primary language metri…
Browse files Browse the repository at this point in the history
…c to list
  • Loading branch information
DJAndries committed Dec 13, 2023
1 parent c3c365c commit 8b94803
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/p3a/metric_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ inline constexpr auto kEphemeralHistograms =
"Brave.WebTorrent.UsageWeekly"
});

// List of metrics that should only be via STAR/Constellation.
// TODO(djandries): remove this once JSON deprecation is complete
inline constexpr auto kConstellationOnlyHistograms =
base::MakeFixedFlatSetSorted<std::string_view>({
"Brave.Core.PrimaryLang",
});

// clang-format on

} // namespace p3a
Expand Down
3 changes: 3 additions & 0 deletions components/p3a/p3a_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ void P3AService::HandleHistogramChange(
only_update_for_constellation);
return;
}
if (kConstellationOnlyHistograms.contains(histogram_name)) {
only_update_for_constellation = true;
}
message_manager_->UpdateMetricValue(std::string(histogram_name), bucket,
only_update_for_constellation);
}
Expand Down

0 comments on commit 8b94803

Please sign in to comment.