Jump to content
Wikimedia Meta-Wiki

Template:Metric infobox

From Meta, a Wikimedia project coordination wiki
Template documentation


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 new editor ( n , t ) {\displaystyle {\text{new editor}}(n,t)} {\displaystyle {\text{new editor}}(n,t)} is a newly registered user completing n {\displaystyle n} {\displaystyle n} edits to a page in a content namespace of a Wikimedia project within t {\displaystyle t} {\displaystyle t} time since registration ( T {\displaystyle T} {\displaystyle T}).
WMF Standard
  • n {\displaystyle n} {\displaystyle n} = 1 edit
  • t {\displaystyle t} {\displaystyle t} = 24 hours
Related metrics
Newly registered user
Status
draft
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.

AltStyle によって変換されたページ (->オリジナル) /