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

Instance status report task reports wrong numbers #2255

Closed
macobo opened this issue Nov 6, 2020 · 2 comments · Fixed by #2271
Closed

Instance status report task reports wrong numbers #2255

macobo opened this issue Nov 6, 2020 · 2 comments · Fixed by #2271
Labels
bug Something isn't working right

Comments

@macobo
Copy link
Contributor

macobo commented Nov 6, 2020

Bug description

persons_count_total and persons_count_new_in_period values are calculated not using persons table, but via events table.

https://github.com/PostHog/posthog/blob/master/posthog/tasks/status_report.py#L35-L42

Expected behavior

The calculation should be correct.

Additional context

Adding some tests to task soon!

cc @Twixes who worked on this report

@macobo macobo added the bug Something isn't working right label Nov 6, 2020
@Twixes
Copy link
Collaborator

Twixes commented Nov 6, 2020

Oof, that's a dumb oversight, obvs should be Person.objects.filter(team_id=team.id) instead of the straight copypaste Event.objects.filter(team_id=team.id). "Adding some tests to task soon!" – are you working on this? If not, I can put in a fix for this rn.

@macobo
Copy link
Contributor Author

macobo commented Nov 6, 2020

Will fix it myself.

macobo added a commit that referenced this issue Nov 9, 2020
macobo added a commit that referenced this issue Nov 9, 2020
macobo added a commit that referenced this issue Nov 10, 2020
* Refactor status report task, add tests

Also discovered issue #2255

* Refactor status report further

* Add DEPLOYMENT env variable to instance status report

Related issue: #2138

* Report posthog_event and posthog_session_recordingevent table sizes

This will help with doing some product decisions

* Fix instance status report person numbers

Fixes #2255

* Handle exceptions in status report

* count(*) fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants