* Show clickhouse disk and system.stats on /instance/status
Part of https://github.com/PostHog/vpc/issues/45
* Show stats on clickhouse table sizes, remove postgres table size stats
* Add metric for whether clickhouse is alive
* Move clickhouse stats above redis
* Revert "Revert "#3765 Show cohort for bar chart (Insights > Trends) (#3825)" (#4052)"
This reverts commit 593679c033.
* patch all time arg
* add missing params
* fix type
* wrong line
* more type safety
* #3765 refactored day to date_from and date_to so that the bar chart may query a date range; the end goal is to show a cohort modal for the graph;
* Removed date from modal label for bar chart since it does not apply
* Added onHover and onClick to ActionsPie charts; Added onClick to ActionsPie to see the people included in Trends > Pie
* date fix
* add time range helper
* add test
* add assertions
Co-authored-by: Eric <eeoneric@gmail.com>
* add query and remove unnecessary functions
* add param function for active user querying
* remove unused import
* fix formatting
* add comment
* add test and complete clickhouse implementation
* add preilim postgres query
* implemented postgres query
* add breakdown test
* breakdown for ch
* working breakdown for clickhouse
* ui
* remove line break
* people for clickhouse
* clickhouse only
* add entity math to payload
* move test
* change dau to null
* fix type
* remove unnecessary imports
* add flags
* Fix docker dev environment
- Use postgres 12 to fix a failing test
- Leverage a yaml anchor to share worker/web services configuration
- Add psql
- Configure psql
* Don't use :cached
* Use Postgres 12 in docker-compose everywhere
* Use postgresql-client-12
* Remove extraneous whitespace
* Clean up dev.Dockerfile
* Clean up EE dev/test docker-compose
* Simplify docker-compose.ch.test.yml
Co-authored-by: Michael Matloka <dev@twixes.com>
* initial api update
* make api work
* frontend changes
* hello
* adjust trend payload
* prelim working
* fix bugs
* use offset in filters to_dict
* use different pagination check
* use offset in filters to_dict
* test
* extend range for pg
* update test
* remove print
* update test
* match limits
* add api test
* center button
* nits
* UI adjustment
* update comment
* fix type error
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* swap out distinct_id table in queries with a subquery that will only consider latest distinct_ids
* wrong import
* fix missin params
* more missing params
* support multiple entries for selector and tag_name filter for EE
* improve support for multiple selector matches
* test for multiple selectors and tag names
* Chunk session recording events
Closes https://github.com/PostHog/posthog/issues/3632 and replaces https://github.com/PostHog/posthog/pull/3566/files
This should make it possible to ingest large full snapshot events
Base64 is used to compress the data for serialization purposes.
pytest.mock is used for clean patching methods
* Mock time.time for py3.7 compatibility
* Group captured $snapshot events by $session_id
* Don't chunk already chunked payloads
* restructure the code
* Clean up complicated function using namedtuple
* Speed up action/event filtering in clickhouse
For very rare events, filtering by them in sessions previously was slow.
This was because the the distinct_id query contained a lot of users who
hadn't done the action, resulting in more looping.
This commit speeds things up by querying users who have done any events matching the
event/action filter.
* Disable useless InsecureRequestWarning
* Disallow ASYNC_EVENT_ACTION_MAPPING on CH and make it default otherwise
* Return early from calculate_actions_from_last_calculation if CH
* Optimize Action.calculate_events and fire hooks from it
* Run calculate_event_action_mappings every 30 s instead of 5 min
* Optimize post_event_to_webhook thanks to new actions approach
* Add Event.site_url field for reworked Postgres webhooks
* Adjust tests by using sync calls to actions calculation
* Update calculate_action.py
* Use assertEntityResponseEqual more
* Update test_capture_new_person for Cloud
* Don't async calculate actions that haven't finished last calculation
* Fix is_calculating condition place
* Improve calculate_actions_from_last_calculation logging
* Clean up event_query, params
* Fix .only usage
* Update migration
* WIP auto filter test accounts
* finish off
* Fix tests
* Non generic emails
* add list of generic emails
* Move location to below property filters
* Fix typescript errors
* as any
* fix tests
* filters
* fix tests
* Featureflag doesn't really makes sense for this feature
* fix tests
* fix test
* Add clickhouse + tests for each insight
* Fix lifecycle and paths
* Fix sessions
* Fix session tests
* fix sesisons test
* fix migrations
* fix migration chain
* refactor path & remove stale console.log
* adjust useAnchor & minor copy
* rename to avoid confusion with inline component
* test account filter tweaks
* fix filters
* hardcode
* Add tests for funnel trends
* Make generic emails super fast
* Fix migrations
* Default to false for now
* Default to false, remember a user's preference
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
* Make PLUGIN_SERVER_INGESTION True by default
* Disable plugin server ingestion in tests by default
This is so that ingestion tests in here, which rely on old ingestion, don't fail. Plugin server ingestion itself is covered well in the plugin server repo.
* Fix limit of events in CSV export
* Limit to 100 instead of 101
* Optimize listing events
* Fix typing error
* Limit events to 100 better
* Fix len condition for using broader events queryset
* Add regression test
* Adjust ClickhouseEventsViewSet
* Fix CH events limit in CSV export
* Fix typing and missing +1
* Use limit in _query_events_list