0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
Commit Graph

3632 Commits

Author SHA1 Message Date
Michael Matloka
d12b09f89e
Improve time to convert binning behavior, add autobinning, expose in API (#4995)
* Improve time to convert binning behavior, add autobinning

* Test and fix custom bin count

* Expose `ClickhouseFunnelTimeToConvert` in the API

* Revert a column name change

* Fix `bin_count` clamping

* Add an API test for viz type `time_to_convert`

* Update SQL comments

* Remove some unused imports

* Fix `FunnelTypeMixin.funnel_viz_type`

* Remove `DEBUG=1`
2021-07-08 17:51:13 +02:00
Sam Winslow
e7c669692d
Fixes / improvements to funnel step UI (#5018)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-08 10:43:42 -05:00
Yakko Majuri
06673114f0
Set PISCINA_ATOMICS_TIMEOUT to 3000 (#5042) 2021-07-08 16:28:03 +02:00
Karl-Aksel Puulmann
714697467c
Load action matching event count async (#5027)
* Load action event count asynchronously

This speeds up loading/editing events quite a bit on clickhouse.

Issue: https://github.com/PostHog/posthog/issues/4802

* Add test for /api/action/{id}/count endpoint

* Update code
2021-07-08 15:14:14 +03:00
Karl-Aksel Puulmann
5f97a8b71c
Don't error in celery for non-replicated clickhouse setups (#5020)
Currently, some metrics queries fail for our clients on clickhouse
deployments since replication is not used there. The errors are ignored
on application-side but they make clickhouse logs impossible to read.

This PR fixes this issue
2021-07-08 10:07:18 +03:00
Karl-Aksel Puulmann
deb9009b0d
Add "Query time breakdown" graph to internal metrics dashboard (#5023)
This came up debugging client performance woes - they were spending 33h
per day updating dashboard item caches.
2021-07-08 09:44:29 +03:00
Alex Gyujin Kim
b24b29d060
Bringing back dashboard item refreshes (#4786)
Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-07 17:45:15 -05:00
Li Yi Yu
b7c257b434
always show funnel persons table (#5032) 2021-07-07 17:16:54 -04:00
PostHog bot
378b91f19e
Update plugin server to 1.1.2 (#5034) 2021-07-07 21:07:37 +01:00
PostHog bot
fcd08f92ea
Update plugin server to 1.1.1 (#5033)
Co-authored-by: posthog-bot <posthog-bot@users.noreply.github.com>
2021-07-07 21:44:28 +02:00
Eric Duong
d5e3bb6475
Replace old funnel step logic (#4923)
* swap out new logic

* remove test

* add other funnel types to insight api

* bring back funnel queries

* add test back
2021-07-07 14:56:19 -04:00
Eric Duong
6e611050aa
Add person select to new funnel query for backwards compatibility (#5019)
* add person select so that we can parse and make api backwards compatible

* move function

* uncomment tests
2021-07-07 13:30:00 -04:00
Li Yi Yu
cd696369c4
case switch display fix (#5029) 2021-07-07 11:33:32 -04:00
Neil Kakkar
7d5e8a7e30
Step time conversions for Unordered funnels (#5024)
* initial attempt to figure out unordered time conversions

* setup unordered funnel conversion times

* cleanup
2021-07-07 15:18:27 +00:00
Tim Glaser
5f242b2bed
Solve ospath issue (#5014)
* Solve ospath issue

* try separate cypress cache

* Separate install

* ls

* try

* Try to put everything in same cache

* Remove cypress plugin snapshot

* fix cohorts and funnels
2021-07-07 14:04:39 +02:00
Tim Glaser
83c48b2f84
Fix direct navigation to graph (#5022) 2021-07-07 10:53:08 +00:00
Karl-Aksel Puulmann
3a979c0695
Don't force _health endpoint redirect to https (#5007)
Closes https://github.com/PostHog/posthog/issues/4726

Note that this does not work on cloud - we'd need to exclude the
endpoint in the AWS ELB as well.
2021-07-07 09:04:28 +03:00
Kunal
8fc9c90245
Change home default behavior, don't route by default (#5000) 2021-07-07 03:13:47 +02:00
Sam Winslow
ad63386a69
Polyfill Object.fromEntries (for Safari <= 12) (#4999) 2021-07-06 19:47:51 -04:00
Eric Duong
ef0f9afc03
add missin funnel trends param (#5015) 2021-07-06 14:51:15 -04:00
Li Yi Yu
90042024a7
Connect funnel persons (#5013)
* connect funnel persons to the frontend

* fixes

* simplify feature flag call and open persons modal on bar click

* persons dropoff call

* move methods to kea and clean up code

* remove unused imports

* round the percentage down

* pass in correct step number

* type fix

* small fixes

* prettier

* clickhouse enabled check

* fix clickhouse enabled check

Co-authored-by: Li Y Yu <liyi@Lis-MacBook-Pro.local>
2021-07-06 13:56:26 -04:00
Tim Glaser
52994907a2
Revert "Connect funnel persons to the frontend (#4953)" (#5012)
This reverts commit 05418cdd89.
2021-07-06 19:24:36 +02:00
Li Yi Yu
05418cdd89
Connect funnel persons to the frontend (#4953)
* connect funnel persons to the frontend

* fixes

* simplify feature flag call and open persons modal on bar click

* persons dropoff call

* move methods to kea and clean up code

* remove unused imports

* round the percentage down

* pass in correct step number

* type fix

* small fixes

* prettier

* clickhouse enabled check

Co-authored-by: Li Y Yu <liyi@Lis-MacBook-Pro.local>
2021-07-06 12:51:36 -04:00
Eric Duong
708dcbbdf5
Funnel steps breakdown (#4949)
* move breakdown logic to separate class

* working breakdown without limits

* add limit logic

* remove print

* arr to dict

* tests

* fix test

* fix tests

* make suggested change

* remove one of the changes

* addjust again

* make funcs pure

* add limit
2021-07-06 12:37:10 -04:00
PostHog bot
53a2fafd1d
Update plugin server to 1.1.0 (#5008) 2021-07-06 15:58:19 +01:00
Alex Gyujin Kim
b9c8cf142a
Sessions table bug fixes (#4964)
* sessions table bug fixes

* match event icon tweak

* code quality

* feature flag that expand

* single expand/collapse button

* update UI of matching events

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-06 16:51:22 +02:00
Tim Glaser
2f88176c46
Display empty values correctly (#4913)
* Display empty values correctly

* fix broken test and I

* handle more cases of empty strings / objects

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-06 16:28:07 +02:00
Yakko Majuri
cd5df835b5
Plugin Metrics UI (#4871)
* Plugin Metrics UI

* remove testing code

* update tests

* add feature flag

* fix title

* rename to 1355plugin_metrics

* always refresh
2021-07-06 10:24:21 -03:00
PostHog bot
c7d9803434
Update plugin server to 1.0.3 (#5005) 2021-07-06 13:19:10 +01:00
Yakko Majuri
0cf66ed6c5
Set PISCINA_ATOMICS_TIMEOUT (#4997) 2021-07-06 11:09:13 +02:00
PostHog bot
1764e2ca93
Update plugin server to 1.0.2 (#5002) 2021-07-06 10:01:17 +01:00
Sam Winslow
a743255fdc
Add horizontally scrolling funnel bar graph & incorporate design changes (#4965)
* Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-06 09:13:22 +02:00
Sam Winslow
660999f7c7
Fix CSS overflow prop on filters (#4994) 2021-07-05 12:45:42 -04:00
Tim Glaser
d765483c5c
Fix index already exists (#4993)
* Fix index already exists

Adds to #4969

* Remove migration from model
2021-07-05 17:01:17 +02:00
Michael Matloka
d655ca7c8d
Fix some insights query building 500s (#4971)
* Fix handling of cohort without match groups

* Fix bug with CH precalculated cohort query building

* Fix `get_person_ids_by_cohort_id`
2021-07-05 11:49:55 +02:00
Paolo D'Amico
1331ab1679
Add to dashboard button in funnels (#4986) 2021-07-05 11:37:46 +02:00
Michael Matloka
239e197e30
PR template wording update (#4876)
* Update pull_request_template.md

* Update pull_request_template.md
2021-07-02 21:18:24 +02:00
Alex Gyujin Kim
299a1121a1
Allow session filters to be deeplinked properly (#4983) 2021-07-02 11:38:08 -07:00
Marius Andra
7bcd721b52
Replace url instead of pushing when changing properties/filters (#4966)
* replace url instead of pushing when changing properties/filters

* missed one
2021-07-02 17:02:13 +02:00
Michael Matloka
64a7f0fb8e
Fix funnel trends backwards compatibility (#4978)
* Fix funnel trends backwards compatibility

* Don't set funnel_viz_type outside of funnel insight filters

* Reorder conditions for clarity and use null check
2021-07-02 14:26:21 +00:00
Karl-Aksel Puulmann
a1e2f14060
Use redis for axes handler (#4975)
* Use redis for axes handler

Original motivation: axes is running into `InterfaceError: connection already closed`
for database (pg) connections. Not sure what that is caused by, but it's
causing api requests to sporatically fail hence reducing reliability.

Sentry issue: https://sentry.io/organizations/posthog/issues/1905826905/?project=1899813&statsPeriod=14d

This error seems to be only occurring in axes hence making me think
switching out the handler will work wonders.

Switching the handler to redis has other benefits as well. As axes is
hit every request this should speed things up. To quote documentation:

> axes.handlers.cache.AxesCacheHandler only uses the cache for monitoring attempts and does not persist data other than in the cache backend; this data can be purged automatically depending on your cache configuration, so the cache handler is by design less secure than the database backend but offers higher throughput and can perform better with less bottlenecks.

* Disable axes during testing
2021-07-02 14:16:28 +02:00
Karl-Aksel Puulmann
d899ea8373
Return a 512 error if query would be estimated to time out (#4973) 2021-07-02 13:35:18 +03:00
posthog-contributions-bot[bot]
dca80435ff
🤖: Add chidexebere as a contributor 🎉 (#4962) 2021-07-02 10:31:24 +01:00
Michael Matloka
3f1393c6aa
Don't disable Cypress suite for bot PRs (#4974) 2021-07-02 09:15:32 +00:00
Marius Andra
35aface03f
Fix funnel navigation step-merge (#4939)
* fix when new steps in the url get merged with old steps from values (new steps contain actions, old events)

* set default event in funnels

Co-authored-by: Paolo D'Amico <paolodamico@users.noreply.github.com>
2021-07-01 22:58:15 +00:00
Neil Kakkar
22e02537c4
Setup Funnel Option Type, and proper Funnel[Persons] API routes (#4946)
* setup funnel option type, and proper API for persons and usual funnel routes

* update tests, fix bugs

* make insights compulsory

* nvm

* remove insights key

* fix person caching

* revert problems, fix typings

* address comments

* dont use defaults in mixins

* typing

* cleanup and fix TODOs

* update test

* adapt api to 4957

Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 14:43:44 -04:00
Michael Matloka
2f5266e2cf
Funnel time to convert query (#4947)
* Create funnel_time_to_convert.py

* Create test_funnel_time_to_convert.py

* Remove unused things

* Rework time to convert query to use our own SQL

* Add comments to query

* Fix typo in comment

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>

* Use feedback

* Only override `ClickhouseFunnelTimeToConvert._format_results`

* Switch test users B and C around

* Fix typo

Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 13:41:11 -04:00
Michael Matloka
a5cc8d36df
Handle cohort being filtered on not existing (#4961)
* Raise 400 instead of 500 if filter cohort does not exist

* Actually return empty 200 results instead of 400

Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 13:30:18 -04:00
Neil Kakkar
a5b7b31827
Funnel with Strict Step Ordering (#4890)
* wip: pagination for persons on clickhouse funnels

* wip: added offset support for getting a list of persons; added support for conversion window;

* fixed mypy exception

* helper function to insert data for local testing

* moved generate code into separate class for more functionality later

* corrected person_distinct_id to use the person id from postgres

* minor corrections to generate local class along with addition of data cleanup via destroy() method

* reduce the number of persons who make it to each step

* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;

* funnel persons and tests

* initial implementation

* invoke the funnel or funnel trends class respectively

* add a test

* add breakdown handling and first test

* add test stubs

* remove repeats

* mypy corrections and PR feedback

* run funnel test suite on new query implementation

* remove imports

* corrected tests

* minor test updates

* correct func name

* fix types

* func name change

* move builder functions to funnel base

* add test classe for new funnel

* Handle multiple same events in the funnel (#4863)

* dedup + tests

* deep equality. Tests to come

* write test for entity equality

* finish testing funnels

* clean up comments

* add strict option for funnels

* typing

* use new persons pattern

* persons for funnel strict ordering

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 13:14:40 -04:00
Neil Kakkar
e60e3c7964
Setup Funnel Unordered persons and Testing (#4943)
* wip: pagination for persons on clickhouse funnels

* wip: added offset support for getting a list of persons; added support for conversion window;

* fixed mypy exception

* helper function to insert data for local testing

* moved generate code into separate class for more functionality later

* corrected person_distinct_id to use the person id from postgres

* minor corrections to generate local class along with addition of data cleanup via destroy() method

* reduce the number of persons who make it to each step

* moved funnel queries to a new folder for better organization; separated funnel_persons and funnel_trends_persons into individual classes;

* funnel persons and tests

* initial implementation

* invoke the funnel or funnel trends class respectively

* add a test

* add breakdown handling and first test

* add test stubs

* remove repeats

* mypy corrections and PR feedback

* run funnel test suite on new query implementation

* remove imports

* corrected tests

* minor test updates

* correct func name

* fix types

* unordered step and test

* func name change

* move builder functions to funnel base

* add test classe for new funnel

* resolve issues with unordered funnel

* oops

* remove breakdown, fix mypy error

* Handle multiple same events in the funnel (#4863)

* dedup + tests

* deep equality. Tests to come

* write test for entity equality

* finish testing funnels

* clean up comments

* from O(2^N) to O(N)

* add query intuition blurb

* rm todo

* wip persons

* wip persons 2

* address comments

* test things, fix bugs

* match result format to funnel.py

Co-authored-by: Buddy Williams <buddy@posthog.com>
Co-authored-by: eric <eeoneric@gmail.com>
2021-07-01 12:11:54 -04:00