From 7785257019e0c4c7d01e1c1d8a774ae469f74414 Mon Sep 17 00:00:00 2001 From: Anna Scholtz Date: Mon, 23 Jan 2023 10:09:48 -0800 Subject: [PATCH] Use new percentile UDF --- opmon/cli.py | 11 ++++++----- opmon/statistic.py | 4 ++-- setup.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/opmon/cli.py b/opmon/cli.py index 5cb070b..cebc7e8 100644 --- a/opmon/cli.py +++ b/opmon/cli.py @@ -371,7 +371,7 @@ def backfill( continue # resolve config by applying platform and custom config specs - spec = MonitoringSpec.from_definition_spec(copy.deepcopy(platform_definitions.spec)) + spec = MonitoringSpec.from_definition_spec(copy.deepcopy(platform_definitions)) platform_defaults = ConfigLoader.configs.get_platform_defaults(platform) if platform_defaults is not None: spec.merge(platform_defaults) @@ -487,13 +487,14 @@ def preview( if start_date is None and end_date is None: start_date = datetime.today() - timedelta(days=3) end_date = datetime.today() - timedelta(days=1) + start_date = pytz.utc.localize(start_date) + end_date = pytz.utc.localize(end_date) elif start_date is None: start_date = end_date - timedelta(days=3) - else: + start_date = pytz.utc.localize(start_date) + elif end_date is None: end_date = start_date + timedelta(days=3) - - start_date = pytz.utc.localize(start_date) - end_date = pytz.utc.localize(end_date) + end_date = pytz.utc.localize(end_date) table = bq_normalize_name(slug) diff --git a/opmon/statistic.py b/opmon/statistic.py index 11e483a..0c0ea2f 100644 --- a/opmon/statistic.py +++ b/opmon/statistic.py @@ -174,7 +174,7 @@ class Percentile(Statistic): def _scalar_compute(self, metric: Metric): return f""" - jackknife_percentile_ci( + `moz-fx-data-shared-prod.udf_js.bootstrap_percentile_ci`( {self.percentiles}, merge_histogram_values( ARRAY_CONCAT_AGG( @@ -200,7 +200,7 @@ class Percentile(Statistic): def _histogram_compute(self, metric: Metric): return f""" - jackknife_percentile_ci( + `moz-fx-data-shared-prod.udf_js.bootstrap_percentile_ci`( {self.percentiles}, merge_histogram_values( ARRAY_CONCAT_AGG( diff --git a/setup.py b/setup.py index ce3a040..cb6c6b7 100644 --- a/setup.py +++ b/setup.py @@ -62,7 +62,7 @@ setup( "pytz", "requests", "toml", - "mozilla-jetstream-config-parser", + "mozilla-metric-config-parser", ], include_package_data=True, tests_require=test_dependencies,