Skip to content

Commit

Permalink
Add "day zero" metrics to refcode inclusion list
Browse files Browse the repository at this point in the history
  • Loading branch information
DJAndries committed Mar 22, 2024
1 parent cffd773 commit 8eddd3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions components/p3a/metric_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,16 @@ inline constexpr auto kEphemeralHistograms =
inline constexpr auto kConstellationOnlyHistograms =
base::MakeFixedFlatSet<std::string_view>(base::sorted_unique,{
"Brave.Core.PrimaryLang",
"Brave.DayZero.Off.InstallTime",
"Brave.DayZero.On.InstallTime",
});

// List of metrics which will include the stored refcode when transmitted
// via the STAR/Constellation protocol.
inline constexpr auto kHistogramsWithRefcodeIncluded =
base::MakeFixedFlatSet<std::string_view>(base::sorted_unique,{
// TODO(djandries): Replace this metric with the first metric
// to include a refcode.
"Brave.ExampleMetric"
"Brave.DayZero.Off.InstallTime",
"Brave.DayZero.On.InstallTime",
});

// clang-format on
Expand Down
6 changes: 4 additions & 2 deletions components/p3a/star_randomness_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ std::string HandleRandomnessRequest(const network::ResourceRequest& request,
rust::Vec<constellation::VecU8> req_points_rust;
const base::Value::List* points_list = req_parsed_val.FindList("points");

EXPECT_EQ(points_list->size(), 8U);
EXPECT_GE(points_list->size(), 8U);
EXPECT_LE(points_list->size(), 9U);

std::transform(
points_list->begin(), points_list->end(),
Expand All @@ -72,7 +73,8 @@ std::string HandleRandomnessRequest(const network::ResourceRequest& request,
auto rand_result =
constellation::generate_local_randomness(req_points_rust, expected_epoch);

EXPECT_EQ(rand_result.points.size(), 8U);
EXPECT_GE(rand_result.points.size(), 8U);
EXPECT_LE(rand_result.points.size(), 9U);

base::Value::List resp_points_list;
for (const constellation::VecU8& resp_point_rust : rand_result.points) {
Expand Down

0 comments on commit 8eddd3a

Please sign in to comment.