-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(trends): add moving average
smoothing_intervals
param (#6435)
* feat(trends): add moving average `smoothing_intervals` param This will average over the preceding `smoothing_intervals` intervals. The driver for this is to remove either weekly or monthly trends. Limitations at the moment are that it only works for total volume queries, as it relies on the results from clickhouse being from a single timeline series. * WIP UI for selecting smoothing * WIP: Fix typing and appearce logic * Made smoothing extensible beyond day * Test now considers a non-trivial case * chore(smoothing): use url params for state storage of smoothing value This should allow for url navigation to work, although I haven't quite figured out how we then use this to make the insights/trends POST request * Added further tests for smoothing intervals * fix test_to_dict * fix trend tests * Added test to validate preceeding limit * Fixed test for 2 interval * clear django redis cache before each test * add explicit ordering to dashboard items in refresh test Otherwise the test is not deterministic. * Revert "clear django redis cache before each test" This is a good thing to do, but I don't want to open up a discussion on this PR. It was not fix for the immediate intermittent test_refresh_cache test This reverts commit aa52f33. * format * clickhouse trends: SET allow_experimental_window_functions = 1 * fix setting of allow_experimental_window_functions * add cache clears for requests * Delete SmoothingFilterLogic.ts Removed smoothing filter logic file * Use `SMOOTHING_INTERVALS` instead of string literal This should ensure that if we update the url param key somewhere, we don't have to remember to change it here as well. Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> * move test_trends to ee * actually delete test_trends.py * Transitioned smoothing logic to use Logic * WIP: Moving away from url based logic * WIP: Refactored logic on listeners * fix storybook * refactor * set redis url * remove keastory * Move interval filter to setFilters insight logic * update trend snapshots * run prettier * Add stickiness test deps that were in test_trends * Fix storybook * fix stickiness tests * update snapshot * fix cohort test * only display smoothing on linear * fix tests * Add some tests * added box to make dropdown consistent * Floor * fix tests * fix tests * fix test * Add feature flag Co-authored-by: Marcus Hyett <marcus@posthog.com> Co-authored-by: Marcus Hyett (PostHog) <85295485+marcushyett-ph@users.noreply.github.com> Co-authored-by: Neil Kakkar <neilkakkar@gmail.com> Co-authored-by: Tim Glaser <tim@glsr.nl>
- Loading branch information
1 parent
7759947
commit fbdefda
Showing
22 changed files
with
712 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.