Skip to content

Commit

Permalink
Update Reporting V2 Cli tool to include MetricCalculationSpec (#1391)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanvuong2021 authored and ple13 committed Aug 16, 2024
1 parent 112a821 commit 3c55a0f
Show file tree
Hide file tree
Showing 6 changed files with 591 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ kt_jvm_library(
"//src/main/proto/wfa/measurement/api/v2alpha:data_providers_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/api/v2alpha:event_group_metadata_descriptors_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:event_groups_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:metric_calculation_specs_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:reporting_sets_service_kt_jvm_grpc_proto",
"//src/main/proto/wfa/measurement/reporting/v2alpha:reports_service_kt_jvm_grpc_proto",
"@wfa_common_jvm//imports/java/picocli",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,7 @@ Reporting \
--reporting-metric-entry='
key: "measurementConsumers/VCTqwV_vFXw/reportingSets/abc"
value {
metric_calculation_specs {
display_name: "spec_1"
metric_specs {
reach {
privacy_params {
epsilon: 0.0041
delta: 1.0E-12
}
}
vid_sampling_interval {
width: 0.01
}
}
}
metric_calculation_specs: "measurementConsumers/Dipo47pr5to/metricCalculationSpecs/abc"
}
'
```
Expand Down Expand Up @@ -150,6 +137,84 @@ Reporting \
reports get measurementConsumers/VCTqwV_vFXw/reports/abcd
```

### metric-calculation-specs

#### create

```shell
Reporting \
--tls-cert-file=secretfiles/mc_tls.pem \
--tls-key-file=secretfiles/mc_tls.key \
--cert-collection-file=secretfiles/reporting_root.pem \
--reporting-server-api-target=v2alpha.reporting.dev.halo-cmm.org:8443 \
metric-calculation-specs create \
--parent=measurementConsumers/VCTqwV_vFXw \
--id=abcd \
--display-name=display \
--metric-spec='
reach {
privacy_params {
epsilon: 0.0041
delta: 1.0E-12
}
}
vid_sampling_interval {
width: 0.01
}
' \
--metric-spec='
impression_count {
privacy_params {
epsilon: 0.0041
delta: 1.0E-12
}
}
vid_sampling_interval {
width: 0.01
}
' \
--filter='person.gender == 1' \
--grouping='person.gender == 1,person.gender == 2' \
--grouping='person.age_group == 1,person.age_group == 2' \
--day-of-the-week=2 \
--day-window-count=5
```

The `--metric-spec` option expects a
[`MetricSpec`](../../../../../../../../../proto/wfa/measurement/reporting/v2alpha/metric.proto)
protobuf message in text format. You can use shell quoting for a multiline string, or
use command substitution to read the message from a file e.g. `--metric-spec=$(cat
metric_spec.textproto)`.

MetricFrequencySpec expects `--daily`, `--day-of-the-week`, or
`--day-of-the-month`. `--daily` is a boolean and `--day-of-the-week` is
represented by 1-7, with 1 being Monday.

TrailingWindow expects `--day-window-count`, `--week-window-count`, or
`--month-window-count`.

#### list

```shell
Reporting \
--tls-cert-file=secretfiles/mc_tls.pem \
--tls-key-file=secretfiles/mc_tls.key \
--cert-collection-file=secretfiles/reporting_root.pem \
--reporting-server-api-target=v2alpha.reporting.dev.halo-cmm.org:8443 \
metric-calculation-specs list --parent=measurementConsumers/VCTqwV_vFXw
```

#### get

```shell
Reporting \
--tls-cert-file=secretfiles/mc_tls.pem \
--tls-key-file=secretfiles/mc_tls.key \
--cert-collection-file=secretfiles/reporting_root.pem \
--reporting-server-api-target=v2alpha.reporting.dev.halo-cmm.org:8443 \
metric-calculation-specs get measurementConsumers/VCTqwV_vFXw/metricCalculationSpecs/abcd
```

### event-groups

#### list
Expand Down
Loading

0 comments on commit 3c55a0f

Please sign in to comment.