Skip to content

Commit

Permalink
revert: "feat: mobile replay in usage" (#21789)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Apr 24, 2024
1 parent c7ff7ab commit a8eccd4
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 251 deletions.
146 changes: 51 additions & 95 deletions posthog/tasks/test/__snapshots__/test_usage_report.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.10
'''

SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='decide usage'
AND timestamp between '2022-01-01 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.11
'''

SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='local evaluation usage'
AND timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.12
'''

SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
Expand All @@ -61,7 +35,7 @@
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.13
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.11
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -78,7 +52,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.14
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.12
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -95,7 +69,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.15
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.13
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -112,7 +86,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.16
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.14
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -129,7 +103,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.17
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.15
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -146,7 +120,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.18
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.16
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -163,7 +137,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.19
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.17
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -180,22 +154,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.2
'''

SELECT team_id,
count(distinct toDate(timestamp), event, cityHash64(distinct_id), cityHash64(uuid)) as count
FROM events
WHERE timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND event != '$feature_flag_called'
AND event NOT IN ('survey sent',
'survey shown',
'survey dismissed')
AND person_mode = 'full'
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.20
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.18
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -212,7 +171,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.21
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.19
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -229,7 +188,22 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.22
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.2
'''

SELECT team_id,
count(distinct toDate(timestamp), event, cityHash64(distinct_id), cityHash64(uuid)) as count
FROM events
WHERE timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND event != '$feature_flag_called'
AND event NOT IN ('survey sent',
'survey shown',
'survey dismissed')
AND person_mode = 'full'
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.20
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -246,7 +220,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.23
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.21
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -263,7 +237,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.24
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.22
'''
WITH JSONExtractInt(log_comment, 'team_id') as team_id,
JSONExtractString(log_comment, 'query_type') as query_type,
Expand All @@ -280,7 +254,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.25
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.23
'''

SELECT team_id,
Expand All @@ -291,7 +265,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.26
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.24
'''

SELECT team_id,
Expand All @@ -302,7 +276,7 @@
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.27
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.25
'''

SELECT team,
Expand Down Expand Up @@ -354,14 +328,9 @@

SELECT team_id,
count(distinct session_id) as count
FROM
(SELECT any(team_id) as team_id,
session_id
FROM session_replay_events
WHERE min_first_timestamp BETWEEN '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
GROUP BY session_id
HAVING ifNull(argMinMerge(snapshot_source), 'web') == 'web')
WHERE session_id NOT IN
FROM session_replay_events
WHERE min_first_timestamp BETWEEN '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND session_id NOT IN
(SELECT DISTINCT session_id
FROM session_replay_events
WHERE min_first_timestamp BETWEEN '2022-01-09 00:00:00' AND '2022-01-10 00:00:00'
Expand All @@ -374,47 +343,34 @@

SELECT team_id,
count(distinct session_id) as count
FROM
(SELECT any(team_id) as team_id,
session_id
FROM session_replay_events
GROUP BY session_id
HAVING ifNull(argMinMerge(snapshot_source), 'web') == 'web')
FROM session_replay_events
GROUP BY team_id
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.7
'''

SELECT team_id,
count(distinct session_id) as count
FROM
(SELECT any(team_id) as team_id,
session_id
FROM session_replay_events
WHERE min_first_timestamp BETWEEN '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
GROUP BY session_id
HAVING ifNull(argMinMerge(snapshot_source), 'web') == 'mobile')
WHERE session_id NOT IN
(SELECT DISTINCT session_id
FROM session_replay_events
WHERE min_first_timestamp BETWEEN '2022-01-09 00:00:00' AND '2022-01-10 00:00:00'
GROUP BY session_id)
GROUP BY team_id
SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='decide usage'
AND timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.8
'''

SELECT team_id,
count(distinct session_id) as count
FROM
(SELECT any(team_id) as team_id,
session_id
FROM session_replay_events
GROUP BY session_id
HAVING ifNull(argMinMerge(snapshot_source), 'web') == 'mobile')
GROUP BY team_id
SELECT distinct_id as team,
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='decide usage'
AND timestamp between '2022-01-01 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
'''
# ---
# name: TestFeatureFlagsUsageReport.test_usage_report_decide_requests.9
Expand All @@ -424,7 +380,7 @@
sum(JSONExtractInt(properties, 'count')) as sum
FROM events
WHERE team_id = 2
AND event='decide usage'
AND event='local evaluation usage'
AND timestamp between '2022-01-10 00:00:00' AND '2022-01-10 23:59:59'
AND has(['correct'], replaceRegexpAll(JSONExtractRaw(properties, 'token'), '^"|"$', ''))
GROUP BY team
Expand Down
Loading

0 comments on commit a8eccd4

Please sign in to comment.