Gather an experiment's metric statistics from the warehouse and reduce them to the stored results payload.
(
experiment: "Experiment",
*,
window_start: "datetime",
window_end: "datetime",
)
| 313 | |
| 314 | |
| 315 | def compute_results_summary( |
| 316 | experiment: "Experiment", |
| 317 | *, |
| 318 | window_start: "datetime", |
| 319 | window_end: "datetime", |
| 320 | ) -> ResultsSummary: |
| 321 | """Gather an experiment's metric statistics from the warehouse and reduce |
| 322 | them to the stored results payload.""" |
| 323 | specs = _experiment_metric_specs(experiment) |
| 324 | aggregates = get_metric_variant_stats( |
| 325 | environment_key=experiment.environment.api_key, |
| 326 | feature_name=experiment.feature.name, |
| 327 | window_start=window_start, |
| 328 | window_end=window_end, |
| 329 | specs=specs, |
| 330 | ) |
| 331 | return build_results_summary( |
| 332 | aggregates, |
| 333 | expected_shares=_expected_variant_shares(experiment), |
| 334 | ) |
| 335 | |
| 336 | |
| 337 | def _experiment_metric_specs(experiment: "Experiment") -> list[MetricSpec]: |
no test coverage detected
searching dependent graphs…