Skip to content

feat(matrix): Add option to save simulate_matrix like setup_dev #9836

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

Merged
merged 3 commits into from
May 19, 2022

Conversation

Twixes
Copy link
Member

@Twixes Twixes commented May 18, 2022

Problem

#7889 added manage.py command simulate_matrix, which simulates users of a product and prints output. There was no way to save that output to the DB however.

Changes

This makes all simulate_matrix arguments optional and adds a new one: --save-as, which is the email of the account that should be created to save the output. The password is 12345678.
Also refactored datetimes to be timezone-aware so that Django doesn't complain.

This kind of makes setup_dev deprecated, but it's used in E2E tests, so not removing here.

How did you test this code?

Ran DEBUG=1 ./manage.py simulate_matrix --save-as michael@posthog.com

@Twixes Twixes requested a review from mariusandra May 18, 2022 11:40
Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff!

I ran into a tricky issue though: after I made my user, I logged in, but the plugin server hadn't caught up and the charts rendered blank. For example there were no countries on the map. Only after a reload did something show up.

Not sure what can be done about that, other than directing the user to the live events view as the first thing to show what to expect 🤔

@Twixes
Copy link
Member Author

Twixes commented May 19, 2022

Hmm, I think the map issue might have been that breakdown_type and breakdown were missing.
The events in fact don't go through the plugin server but straight into the final Kafka topic, for performance, so they should arrive into ClickHouse very quickly.

@Twixes Twixes enabled auto-merge (squash) May 19, 2022 10:19
@Twixes Twixes merged commit b0faccb into master May 19, 2022
@Twixes Twixes deleted the save-simulate-matrix branch May 19, 2022 11:14
fuziontech added a commit that referenced this pull request May 19, 2022
* master:
  refactor(ingestion): Make `KAFKA_ENABLED` true by default and set `KAFKA_HOSTS` default (#9844)
  feat(apps): transpile frontend.tsx (#9828)
  feat: show api call status when adding insights to dashboards (#9817)
  feat: track metrics on zapier hook firings (#9866)
  fix(onboarding): instrumentation (#9845)
  feat(whitelabel-shared-dashboard): Hide branding on shared dashboards paid (#9849)
  fix(apps): plugin source quickfix (#9862)
  refactor(plugin-server): Remove `ts-jest`, use `jest.mocked` (#9861)
  refactor(plugin-server): Trigger public jobs with graphile insted of celery queue (#9811)
  chore: upgrade pip tools (#9859)
  feat(apps): plugin source in its own model, part 2 (#9854)
  chore: Update sprint_planning_retro.md (#9791)
  feat(apps): plugin source in its own model, part 1 (#9853)
  feat(matrix): Add option to save `simulate_matrix` like `setup_dev` (#9836)
  fix(cohort): add mapping from event to person (#9841)
  feat(person-on-events): Enable CI to run using both old and new queries (#9814)
alexkim205 pushed a commit that referenced this pull request May 23, 2022
…9836)

* feat(matrix): Add option to save `simulate_matrix` like `setup_dev`

* Fix signups map

* Improve handling of error and success with `--save-as`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants