Closed Bug 916229 Opened 12 years ago Closed 10 years ago

Automatically update community stats on homepage

Categories

(developer.mozilla.org Graveyard :: General, defect, P3)

All
Other
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jswisher, Unassigned, Mentored)

References

Details

(Whiteboard: [specification][type:feature])

What problems would this solve? =============================== The mockup of the redesigned front page (http://cl.ly/image/2r2P342g0c2F/o) includes a "Get Involved" box with community stats: X contributors from Y countries in Z languages The purpose of this box is to show that MDN is a community-created, global resource. Who would use this? =================== These stats would be displayed on the front page of MDN. What would users see? ===================== Something like http://cl.ly/image/2r2P342g0c2F/o What would users do? What would happen as a result? =================================================== Users would think "Oh, cool, I could contribute to this, too." and would click the "Contribute to MDN" button to learn more. Is there anything else we should know? ====================================== These stats can be specified as: * X: Number of unique contributors (users who have made an edit) in the last 12 months * Y: Number of countries, based on IP address, for contributors in the last 12 months. This could be for logged-in users, rather than editors, if that's easier. * Z: Number of locales that have been edited in the last 12 months. These do not need to be updated frequently. Weekly or even monthly is fine.
Blocks: 914828
Blocks: 917497
No longer blocks: 914828
Blocks: 917852
No longer blocks: 917852
Depends on: 916228
Summary: Collect and display community stats on front page → Update homepage with community stats
Final copy: Join 3,414 contributors in 31 languages and locales around the world.
This bug is not about the initial stats. This bug is about updating the stats on an ongoing, periodic basis. If we have to do it manually, it won't happen and will get stale.
Ah, I closed the wrong one. Thanks Janet.
Blocks: 914840
No longer blocks: 917497
Summary: Update homepage with community stats → Automatically update community stats on homepage
Blocks: MDNPostLaunch
No longer blocks: 914840
Blocks: 914840
No longer blocks: 914840
Blocks: 910513
No longer blocks: 910513
Priority: -- → P1
Jannis -- can you hook me up with the python / optimized queries to get these numbers? Will these DB calls slow down the homepage? We should consider speed since it's the homepage
Flags: needinfo?(jezdez)
:davidwalsh Sure thing, this is likely going to be a costly query. But I'll wrap it in a caching call on Python side and write a periodic Celery task to update the cache (assuming we'll have Memcache soon). In other words it's a little more involved due to it being the homepage. Can we do it like with the search where you work with dummy data and I'll just hook into the query and caching code once you're done?
Flags: needinfo?(jezdez) → needinfo?(dwalsh)
Sweet! We're actually using hardcoded numbers right now, so my part should be done, unless the numbers are drastically wider somehow. My part should be good to go in the template already, we just need to replace hardcoded numbers with real ones.
Flags: needinfo?(dwalsh)
Note that even if we need up-to-date numbers, we don't need live numbers. Have a task caching the values once a day or once a week is perfectly fine. (feedback Janet to have confirmation of this)
Flags: needinfo?(jswisher)
Yup: (In reply to Janet Swisher from comment #0) > These do not need to be updated frequently. Weekly or even monthly is fine.
Flags: needinfo?(jswisher)
Priority: P1 → P3
FWIW, I realized I overlooked one minor detail that makes this a non-trivial feature. The feature descriptions says: "Y: Number of countries, based on IP address, for contributors in the last 12 months. This could be for logged-in users, rather than editors, if that's easier." We don't currently collect IP addresses in our database and I think we shouldn't due to privacy issues. That leaves us with little other options to figure out which countries the contributors came from (let alone retroactively figure that out): - check the contributor user profile if she has set the country field. problem is that at least I can't even see the country dropdown in the profile edit view - somehow query Google Analytics for a general number of *visitors* for a page that is only used by editors (which would that be?) so that we can fake that a bit There may be other options that I haven't thought about and I'd appreciate input from other devs. Adding Luke to the mix..
Flags: needinfo?(mars)
Flags: needinfo?(lcrouch)
Flags: needinfo?(mars)
Yes, we encountered that issue in creating the original stats box. It currently only lists number of contributors and number of locales (i.e., localizations). Updating that is all that is required, so you can ignore the request for number of countries.
Flags: needinfo?(lcrouch)
The queries for https://bugzilla.mozilla.org/show_bug.cgi?id=916229#c10 are not too hard. Making myself a mentor for any contributor who may want to make that content dynamic. SQL queries for these metrics: X: select count(creator_id) from (select distinct creator_id from wiki_revision where created >= DATE_SUB(NOW(), INTERVAL 1 YEAR)) as contributors_last_12_months; Y: select count(locale) from (select distinct wd.locale from wiki_document wd, wiki_revision wr where wd.id = wr.document_id and wr.created >= DATE_SUB(NOW(), INTERVAL 1 YEAR)) as locales_last_12_months;
Mentor: lcrouch
> The queries for https://bugzilla.mozilla.org/show_bug.cgi?id=916229#c10 are > not too hard. Making myself a mentor for any contributor who may want to > make that content dynamic. Hi, I would like to contribute on this.
Thanks Francisco. Did you get my email about the patch? If you can, please send it as a GitHub pull request, or you can attach it as a patch to this bug. Thanks!
Flags: needinfo?(francisco)
Flags: needinfo?(francisco)
Mentor: lcrouch → jezdez
Thanks Francisco!
This is fixed and deployed for a while now.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.