Skip to content

Commit

Permalink
feat: test small values for artificial lag (#22296)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed May 15, 2024
1 parent 5b80840 commit d5acfa7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const FEATURE_FLAGS = {
THEME: 'theme', // owner: @aprilfools
SESSION_TABLE_PROPERTY_FILTERS: 'session-table-property-filters', // owner: @robbie-c
SESSION_REPLAY_HOG_QL_FILTERING: 'session-replay-hogql-filtering', // owner: #team-replay
SESSION_REPLAY_ARTIFICIAL_LAG: 'artificial-lag-query-performance', // owner: #team-replay
} as const
export type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
hog_ql_filtering: values.useHogQLFiltering,
}

if (values.artificialLag) {
params['date_to'] = values.artificialLag
}

if (values.orderBy === 'start_time') {
if (direction === 'older') {
params['date_to'] =
Expand Down Expand Up @@ -487,6 +491,14 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
},
})),
selectors({
artificialLag: [
(s) => [s.featureFlags],
(featureFlags): string | null => {
const lag = featureFlags[FEATURE_FLAGS.SESSION_REPLAY_ARTIFICIAL_LAG]
// you can't edit variants right now, and I didn't put minus on the variant name 馃し
return lag === undefined || lag === 'control' ? null : '-' + lag
},
],
useHogQLFiltering: [
(s) => [s.featureFlags],
(featureFlags) => !!featureFlags[FEATURE_FLAGS.SESSION_REPLAY_HOG_QL_FILTERING],
Expand Down

0 comments on commit d5acfa7

Please sign in to comment.