Template:Metric infobox
Appearance
From Meta, a Wikimedia project coordination wiki
Usage
[edit ]- input
{{Metric infobox | name = New editor | filename = Wiki_metrics.new_editor.svg | measures = [[R:Editor activation|Editor activation]] & [[R:Editor productivity|Editor productivity]] | specification = A '''<math>\text{new editor}(n, t)</math>''' is a [[R:Newly registered user|newly registered user]] completing <math>n</math> edits to a page in a [[R:content namespace|content namespace]] of a Wikimedia project within <math>t</math> time since registration (<math>T</math>). | wmf-standard = * <math>n</math> = 1 edit * <math>t</math> = 24 hours | aliases = [[R:First-time editor|First-time editor]] | related-metrics = [[Research:Newly registered user|Newly registered user]] | status = draft | repository = [https://github.com/halfak/Productive-new-editor-demonstration https://github.com/halfak/Productive-new-editor-demonstration] | sql = <syntaxhighlight lang="SQL"> SET @content_namespaces = (0); /* ... snip ... */ GROUP BY 1,2,3 HAVING SUM(content_revisions) >= @n; </syntaxhighlight> }}
- output
New editor
Specification
A {\displaystyle {\text{new editor}}(n,t)} is a newly registered user completing {\displaystyle n} edits to a page in a content namespace of a Wikimedia project within {\displaystyle t} time since registration ({\displaystyle T}). WMF Standard
- {\displaystyle n} = 1 edit
- {\displaystyle t} = 24 hours
Aliases
First-time editor Related metrics
Newly registered user SQL
SET@content_namespaces=(0); SET@t=1;/* time cutoff in days */ SET@n=1;/* edits threshold */ /* Results in a set of "new editors" */ SELECT user_id, user_name, user_registration FROM ( /* Get revisions to content pages that are still visible */ SELECT user_id, user_name, user_registration, IFNULL(SUM(page_namespaceIN(@content_namespaces)),0)AScontent_revisions FROMuser LEFTJOINrevisionONrev_user=user_id LEFTJOINpageON rev_page=page_idAND rev_timestamp<=DATE_FORMAT( DATE_ADD(user_registration,INTERVAL@tDAY), '%Y%m%d%H%i%S') GROUPBY1,2 UNION /* Get revisions to content pages that have been archived */ SELECT user_id, user_name, user_registration, IFNULL(SUM(ar_namespaceIN(@content_namespaces)),0)AScontent_revisions FROMuser LEFTJOINarchiveON ar_user=user_idAND ar_timestamp<=DATE_FORMAT( DATE_ADD(user_registration,INTERVAL@tDAY), '%Y%m%d%H%i%S') GROUPBY1,2,3 )ASuser_content_revision_count GROUPBY1,2,3 HAVINGSUM(content_revisions)>=@n;
The above documentation is transcluded from Template:Metric infobox/doc. (edit | history)
Editors can experiment in this template’s sandbox (create | mirror) and testcases (create) pages.
Please add categories to the /doc subpage. Subpages of this template.
Editors can experiment in this template’s sandbox (create | mirror) and testcases (create) pages.
Please add categories to the /doc subpage. Subpages of this template.