-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add ratio charts #72
Add ratio charts #72
Conversation
Hmm commits from the merged PR still listed here - mind rebasing this? Also, screenshots would be nice :) |
…er user charts to _stats_with_selectors
3605678
to
4f13c2d
Compare
Rebased. Not much to see in the screenshots, only the new buttons, not correctly styled (I need to make everything responsive). I just try to reach the "feature complete" state and will polish the design after that. |
src/database.js
Outdated
users / nodes AS users_per_node,\ | ||
active_users_monthly / users AS active_users_ratio,\ | ||
local_posts / users AS posts_per_user,\ | ||
local_comments / users AS comments_per_user \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a high risk of division by zero here, at least in development environments. Any way you could get these calculations to avoid that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, nice check. I'll think about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the NULLIF function but the app wasn't crashing before the fix even with an entry with all stats to 0. Can't hurt so I added it anyway.
src/database.js
Outdated
FROM (SELECT UNIX_TIMESTAMP(date) AS timestamp,\ | ||
COUNT(pod_id) AS nodes,\ | ||
SUM(total_users) AS users,\ | ||
SUM(active_users_halfyear) AS active_users_halfyear,\ | ||
SUM(active_users_monthly) AS active_users_monthly,\ | ||
SUM(local_posts) AS local_posts,\ | ||
SUM(local_comments) AS local_comments \ | ||
FROM stats s"; | ||
FROM stats s";; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this probably doesn't matter, there is an extra ;
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
455a412
to
08e4588
Compare
Thanks! |
\o/ |
Add users per node, active users ratio, posts per user and comments per user charts to _stats_with_selectors. So we start to get power out of numbers and have other interesting calculated indicators. Base on #71 so please merge the other one first.