Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Create method to BasicReport #1994

Open
wants to merge 3 commits into
base: kungfucraig/mcapiphaseone
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/proto/wfa/measurement/reporting/v2alpha/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ proto_library(
"@com_google_googleapis//google/api:client_proto",
"@com_google_googleapis//google/api:field_behavior_proto",
"@com_google_googleapis//google/api:resource_proto",
"@com_google_googleapis//google/longrunning:operations_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
Expand Down Expand Up @@ -419,6 +420,11 @@ kt_jvm_grpc_proto_library(
deps = [":metric_calculation_specs_service_proto"],
)

kt_jvm_grpc_proto_library(
name = "operations_service_kt_jvm_grpc_proto",
deps = ["@com_google_googleapis//google/longrunning:operations_proto",],
)

proto_library(
name = "reports_service_proto",
srcs = ["reports_service.proto"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ message BasicReport {
(google.api.field_behavior) = IMMUTABLE
];

// Specifies the Pages to create
repeated PageSpec page_specs = 8 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = REQUIRED
];

// The report results
repeated Page pages = 6 [
(google.api.field_behavior) = IMMUTABLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/timestamp.proto";
import "wfa/measurement/reporting/v2alpha/basic_report.proto";

Expand All @@ -29,6 +30,16 @@ option java_outer_classname = "BasicReportsServiceProto";

// Service for managing `BasicReport` resources.
service BasicReports {
// Creates a `BasicReport`
rpc CreateBasicReport(CreateBasicReportRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2alpha/{parent=measurementConsumers/*}/basicReports"
body: "basicReport"
};
option (google.api.method_signature) = "parent,basicReport";
}

// Returns the `BasicReport` with the given resource key.
rpc GetBasicReport(GetBasicReportRequest) returns (BasicReport) {
option (google.api.http) = {
Expand Down Expand Up @@ -103,11 +114,37 @@ message ListBasicReportsRequest {

// Response message for `ListBasicReports` method.
message ListBasicReportsResponse {
// The Basic Reports that met the filter criteria
// The BasicReports that met the filter criteria
repeated BasicReport basic_reports = 1
[(google.api.field_behavior) = OPTIONAL];

// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for `CreateBasicReport` method
message CreateBasicReportRequest {
// The parent Measurement Consumer
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "reporting.halo-cmm.org/BasicReport"
}
];

// The ID to use for the BasicReport, which will become the final component
// of the BasicReport's resource name.
//
// This must conform to RFC 1034, with the additional restriction that all
// letters must be lower-case.
string basic_report_id = 2 [(google.api.field_behavior) = REQUIRED];

// The BasicReport to create.
BasicReport basic_report = 3;

// A unique identifier for this request. Restricted to 36 ASCII characters.
// A random UUID is recommended.
// This request is only idempotent if a `request_id` is provided.
string request_id = 4;
}
156 changes: 155 additions & 1 deletion src/main/proto/wfa/measurement/reporting/v2alpha/page.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,148 @@ message DimensionSpec {
repeated EventFilter filters = 4 [(google.api.field_behavior) = IMMUTABLE];
}

// Specifies a set of metrics to be computed
message PageMetricSpec {
// If specified the total population for the specified groupings and
// filters that are associated with calculation spec is reported.
bool population_size = 1 [(google.api.field_behavior) = IMMUTABLE];

// The set of basic metrics that can be computed for any aspect of the
// reporting_unit (e.g. the whole thing, a single component, intersections,
// etc.)
message BasicMetricSetSpec {
// The reach
bool reach = 1 [(google.api.field_behavior) = IMMUTABLE];

// The reach divided by the population
bool percent_reach = 2 [(google.api.field_behavior) = IMMUTABLE];

// The k plus reach up to the frequency specified. Value must be
// positive.
int32 k_plus_reach = 3 [(google.api.field_behavior) = IMMUTABLE];

// This option requires that a positive value be given for
// k_plus_reach, in which case if specified the percent k+
// reach values are also computed.
bool percent_k_plus_reach = 4 [(google.api.field_behavior) = IMMUTABLE];

// The average frequency
bool average_frequency = 5 [(google.api.field_behavior) = IMMUTABLE];

// The impression count
bool impressions = 6 [(google.api.field_behavior) = IMMUTABLE];

// Gross ratings points
bool grps = 7 [(google.api.field_behavior) = IMMUTABLE];
}

// Metrics to be computed over the entire reporting_unit
message ReportingUnitMetricSetSpec {
// Metrics for the union of the items in the reporting_unit
BasicMetricSetSpec basic = 1 [(google.api.field_behavior) = IMMUTABLE];

// Compute a stacked incremental reach result for the reporting_unit
//
// For example if the order of the items in the reporting_unit.units
// field is "rs1, rs2, rs3" then the following are reported:
// 1. The reach of rs1
// 2. The incremental reach of (rs1+rs2) over rs1
// (i.e. the unique contribution of rs2 with respect to rs1)
// 3. The incremental reach of (rs1+rs2+rs3) over (rs1+rs2)
// (i.e. the unique contribution of rs3 with respect to rs1 and rs2.
//
// In the case an output for a category of components is desired, this
// can be achieved by first grouping the components by category. Then
// once the output is provided the reach values for the components in the
// category can be summed.
//
// For example, assume we have components EDP1, EDP2, EDP3 and EDP1
// is linear TV and EDP2 and EDP3 are digital, and suppose we want an
// incremental reach report of linear TV over digital. Then we can specify
// the reporting_unit components as [EDP2, EDP3, EDP1] and when the
// output is recieved sum the values for EDP2 and EDP3. This results
// in a vector where the first element is the combined reach of EDP2
// and EDP3 and the second element is the incremental reach of EDP1
// with respect to them. Note that it would also be okay to specify
// the components as [EDP3, EDP2, EDP1].
bool stacked_incremental_reach = 2;
}
// The set of metrics to compute for the entire reporting_unit
ReportingUnitMetricSetSpec reporting_unit = 2;

// Metrics for each component of the reporting_unit
message ComponentMetricSetSpec {
// Basic metrics for each item in reporting_unit.components
BasicMetricSetSpec basic = 1 [(google.api.field_behavior) = IMMUTABLE];

// The unique reach of each item in reporting_unit.components
// with respect to all other components
bool unique_reach = 2 [(google.api.field_behavior) = IMMUTABLE];
}
// If reporting_unit.components is of size 1 the metrics computed for the
// component are identical to those computed for the entire reporting_unit.
// Specifying this value is not recommended in that case.
ComponentMetricSetSpec component = 3
[(google.api.field_behavior) = IMMUTABLE];

// Metrics for the intersections (aka overlaps) of the n-way combinations
// of reporting_unit.components
message ComponentIntersectionMetricSetSpec {
// The number of components that contribute to the intersection.
//
// For example, a value of 2 will provide all 2-way intersections of
// the reporting_unit.components A value of 2 and 3 will provide both the
// 2 and 3 way intersections.
//
// The minimum value is one and the the max value is the number of
// distinct reporting units in reporting_unit.components
repeated int32 contributor_count = 1 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = REQUIRED
];

// Metrics for each intersection
BasicMetricSetSpec basic = 2 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = REQUIRED
];
}
// Metrics for n-way intersections
ComponentIntersectionMetricSetSpec component_intersection = 4
[(google.api.field_behavior) = IMMUTABLE];
}

// Specification for a Page of results.
message PageSpec {
// The title of the page
string title = 1 [(google.api.field_behavior) = IMMUTABLE];

// The unit to compute metrics for
ReportingUnit reporting_unit = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Specifies the window over which metrics are computed
// and whether they are cumulative or not.
WindowingSpec windowing_spec = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Specfies the dimensions over which the report is filtered and grouped.
DimensionSpec dimension_spec = 4 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];

// Specifies the Metrics to compute.
PageMetricSpec page_metric_spec = 5 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE
];
}

// A page of results.
message Page {
// The title of the page.
Expand All @@ -101,7 +243,19 @@ message Page {

// Display name of the component
string display_name = 2 [(google.api.field_behavior) = IMMUTABLE];
// TODO(@kungfucraig): Phase II - Add support for Event Group summaries.

// Summary of an EventGroup entailed by the component
message EventGroupSummary {
string event_group = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
type: "halo.wfanet.org/EventGroup"
}
];
// TODO(@kungfucraig): Add EventGroup metadata once it has been
// formally encoded in the EventGroup.
}
}

// A summary of each component of the reporting_unit reported on
Expand Down