Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(experiments): widen precompute auto-enrollment criteria (#113405)

Juraj Majerikf08eeb65bd71
diff --git a/products/experiments/backend/temporal/enrollment_census_logic.py b/products/experiments/backend/temporal/enrollment_census_logic.py
index 352735b71c81..9535cd425bc8 100644
--- a/products/experiments/backend/temporal/enrollment_census_logic.py
+++ b/products/experiments/backend/temporal/enrollment_census_logic.py
@@ -28,14 +28,14 @@ CENSUS_WINDOW_DAYS = 14
# A team must have this many direct-scan reads in the window for precomputation to have
# enough repeat traffic to amortize its builds. Nightly recalculation counts, deliberately:
# recalc is where precompute saves the most.
-MIN_DIRECT_READS = 50
+MIN_DIRECT_READS = 30
# Pain thresholds. Any one qualifies a team (given MIN_DIRECT_READS).
-SLOW_READ_MS = 15_000
+SLOW_READ_MS = 8_000
SLOW_READ_FRACTION = 0.10
-TOTAL_READ_BYTES_THRESHOLD = 5 * 10**12 # 5 TB rescanned per window
+TOTAL_READ_BYTES_THRESHOLD = 2 * 10**12 # 2 TB rescanned per window
HARD_FAILURE_CODES = (159, 241) # TIMEOUT_EXCEEDED, MEMORY_LIMIT_EXCEEDED
-HARD_FAILURES_THRESHOLD = 5
+HARD_FAILURES_THRESHOLD = 3
# A single read this large means the team's full-window scans approach the per-query byte
# cap, so precompute build INSERTs over the same events likely would too. Enrolling such a
diff --git a/products/experiments/backend/temporal/test_enrollment_census_logic.py b/products/experiments/backend/temporal/test_enrollment_census_logic.py
index 80cafd713146..8777e99bf9dc 100644
--- a/products/experiments/backend/temporal/test_enrollment_census_logic.py
+++ b/products/experiments/backend/temporal/test_enrollment_census_logic.py
@@ -55,9 +55,9 @@ class TestEnrollmentCensusCriteria(BaseTest):
[
("scan_volume", _stats(total_read_bytes=6 * 10**12), ("scan_volume",)),
("slow_read_fraction", _stats(slow_reads=11), ("slow_reads",)),
- ("hard_failures", _stats(hard_failures=5), ("hard_failures",)),
- ("below_all_thresholds", _stats(slow_reads=10, hard_failures=4), ()),
- ("too_few_reads", _stats(direct_reads=49, slow_reads=49, total_read_bytes=6 * 10**12), ()),
+ ("hard_failures", _stats(hard_failures=3), ("hard_failures",)),
+ ("below_all_thresholds", _stats(slow_reads=10, hard_failures=2), ()),
+ ("too_few_reads", _stats(direct_reads=29, slow_reads=29, total_read_bytes=6 * 10**12), ()),
]
)
def test_candidate_criteria(