Skip to content
Permalink
Browse files

fix(scripts): fix off-by-one errors in metrics sample rates

  • Loading branch information...
philbooth committed Feb 20, 2019
1 parent 3bc9283 commit 40ec2bfb2dacf931b497492b2ec7fe75549db823
Showing with 4 additions and 4 deletions.
  1. +1 −1 import_events.py
  2. +3 −3 import_flow_events.py
@@ -114,7 +114,7 @@ def env_or_default(variable_name, default_value):
STRTOL(SUBSTRING({id_column} FROM 0 FOR 8), 16) % 100 AS cohort
FROM {temp_table}
)
WHERE cohort <= {percent}
WHERE cohort < {percent}
AND ts::DATE = '{day}'::DATE
AND ts::DATE >= '{max_day}'::DATE - '{months} months'::INTERVAL;
""".format(perm_table=TABLE_NAMES["perm"],
@@ -144,7 +144,7 @@
SELECT *, STRTOL(SUBSTRING(flow_id FROM 0 FOR 8), 16) % 100 AS sample
FROM {table_name}
)
WHERE sample <= {percent}
WHERE sample < {percent}
AND type = 'flow.begin';
"""

@@ -233,7 +233,7 @@
SELECT *, STRTOL(SUBSTRING(flow_id FROM 0 FOR 8), 16) % 100 AS sample
FROM {table_name}
)
WHERE sample <= {percent}
WHERE sample < {percent}
GROUP BY flow_id
) AS metrics_context
WHERE flow_metadata{suffix}.flow_id = metrics_context.flow_id;
@@ -280,7 +280,7 @@
SELECT *, STRTOL(SUBSTRING(flow_id FROM 0 FOR 8), 16) % 100 AS sample
FROM {table_name}
)
WHERE sample <= {percent}
WHERE sample < {percent}
AND type LIKE 'flow.experiment.%';
"""

0 comments on commit 40ec2bf

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.