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

Add ratio charts #72

Merged
merged 3 commits into from
Feb 15, 2017
Merged

Conversation

Flaburgan
Copy link
Contributor

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.

@jaywink
Copy link
Member

jaywink commented Feb 14, 2017

Hmm commits from the merged PR still listed here - mind rebasing this?

Also, screenshots would be nice :)

@Flaburgan
Copy link
Contributor Author

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 \
Copy link
Member

@jaywink jaywink Feb 14, 2017

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@Flaburgan Flaburgan mentioned this pull request Feb 14, 2017
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";;
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@jaywink
Copy link
Member

jaywink commented Feb 15, 2017

Thanks!

@jaywink jaywink merged commit 7a43e64 into thefederationinfo:redesign Feb 15, 2017
@Flaburgan
Copy link
Contributor Author

\o/

@Flaburgan Flaburgan deleted the add-ratio-charts branch February 15, 2017 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants