Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event property counter #7500

Merged
merged 56 commits into from
Dec 17, 2021
Merged
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
598c213
create event property model
mariusandra Dec 3, 2021
b609261
add null
mariusandra Dec 3, 2021
01307be
rename cache vars
mariusandra Dec 3, 2021
37aad8c
update event properties table on ingestion
mariusandra Dec 3, 2021
ed359ea
match date formats
mariusandra Dec 3, 2021
8f80f87
match date formats
mariusandra Dec 3, 2021
17cb696
better string handling
mariusandra Dec 3, 2021
304a740
property type can be null too
mariusandra Dec 3, 2021
586c39b
pass event timestamp
mariusandra Dec 3, 2021
d738f9b
update property type later
mariusandra Dec 3, 2021
4cbc1cc
perform all updates through a buffer object
mariusandra Dec 3, 2021
1ad5949
move to EventPropertyCounter
mariusandra Dec 3, 2021
b9be65f
Merge branch 'master' into event-property-counter
mariusandra Dec 14, 2021
2227052
fix migration
mariusandra Dec 14, 2021
4a1da7c
improve flush last seen at job
mariusandra Dec 14, 2021
e64062a
flush job periodically + env
mariusandra Dec 14, 2021
129532b
upsert all event properties in 1 query
mariusandra Dec 14, 2021
ba1b831
log to statsd
mariusandra Dec 14, 2021
2c3c27d
enable property counter only if experimental mode enabled
mariusandra Dec 14, 2021
f69e68c
use now() instead of event timestamp
mariusandra Dec 14, 2021
1c2a777
fix seconds
mariusandra Dec 14, 2021
356d341
Merge branch 'master' into event-property-counter
mariusandra Dec 14, 2021
6215919
add user/pass for default postgres
mariusandra Dec 14, 2021
30ddc74
add tests
mariusandra Dec 14, 2021
48842e1
use big integers
mariusandra Dec 14, 2021
8e7429f
make query work with 50k props
mariusandra Dec 14, 2021
7162157
processing events saves event properties
mariusandra Dec 14, 2021
6434800
fix script
mariusandra Dec 14, 2021
19c12e1
test date format detection
mariusandra Dec 14, 2021
1ff7d94
default enabled
mariusandra Dec 14, 2021
6486d70
only enable event property counter for specific teams
mariusandra Dec 14, 2021
4895947
Merge branch 'master' into event-property-counter
mariusandra Dec 14, 2021
4026f71
eslint fixes
mariusandra Dec 14, 2021
12d3cc4
Merge branch 'master' into event-property-counter
mariusandra Dec 14, 2021
07b20ee
fix logs double-sync noise in tests
mariusandra Dec 14, 2021
9f16444
fix bigint test
mariusandra Dec 14, 2021
c1dc433
don't do tasks that make no sense
mariusandra Dec 14, 2021
114fd2d
remove dead code
mariusandra Dec 14, 2021
523fddd
simpler test setup
mariusandra Dec 16, 2021
97fdd2d
different contraint name
mariusandra Dec 16, 2021
7a5a8a0
refactor team manager
mariusandra Dec 16, 2021
a61884b
greatly simplify the system
mariusandra Dec 16, 2021
20e893b
fetch cached event properties
mariusandra Dec 16, 2021
3ce42cc
fix team manager and timestamps
mariusandra Dec 16, 2021
0d42e92
add cached entry
mariusandra Dec 16, 2021
fbe080e
also don't cache event properties for teams that have it disabled
mariusandra Dec 16, 2021
8e961b8
remove indexes that are not going to be used
mariusandra Dec 16, 2021
aa638e7
Merge branch 'master' into event-property-counter
mariusandra Dec 16, 2021
e7772ab
remove unused imports
mariusandra Dec 16, 2021
8b01a16
blacked
mariusandra Dec 16, 2021
d070faa
remember event properties with a LRU cache
mariusandra Dec 17, 2021
f0f4f36
fix eslint
mariusandra Dec 17, 2021
a39253a
clean up the last bits
mariusandra Dec 17, 2021
cd463f4
move ONE_HOUR to constants
mariusandra Dec 17, 2021
5db0f2d
use sane_repr
mariusandra Dec 17, 2021
c5469cd
fix typo
mariusandra Dec 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix eslint
mariusandra committed Dec 17, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f0f4f360f8813400e005bb2871ad24486a859a8b
2 changes: 1 addition & 1 deletion plugin-server/src/worker/ingestion/team-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Properties } from '@posthog/plugin-scaffold'
import { StatsD } from 'hot-shots'
import LRU from 'lru-cache'
import { DateTime } from 'luxon'

import { PluginsServerConfig, Team, TeamId } from '../../types'
@@ -8,7 +9,6 @@ import { timeoutGuard } from '../../utils/db/utils'
import { posthog } from '../../utils/posthog'
import { status } from '../../utils/status'
import { getByAge, UUIDT } from '../../utils/utils'
import LRU from 'lru-cache'

type TeamCache<T> = Map<TeamId, [T, number]>