You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/Metrics/App/WikiMetrics.php
+55-4
Original file line number
Diff line number
Diff line change
@@ -4,30 +4,62 @@
4
4
5
5
useApp\Wiki;
6
6
useApp\WikiDailyMetrics;
7
+
useIlluminate\Support\Facades\DB;
8
+
useIlluminate\Support\Arr;
7
9
8
10
class WikiMetrics
9
11
{
12
+
constINTERVAL_DAILY = 'INTERVAL 1 DAY';
13
+
constINTERVAL_WEEKLY = ' INTERVAL 1 WEEK';
14
+
constINTERVAL_MONTHLY = 'INTERVAL 1 MONTH';
15
+
constINTERVAL_QUARTERLY = 'INTERVAL 3 MONTH';
16
+
17
+
constQUERY_NUMBER_OF_ACTIONS = <<<EOF
18
+
SELECT
19
+
SUM(rc_timestamp >= DATE_FORMAT(DATE_SUB(NOW(), ?), '%Y%m%d%H%i%S')) AS sum_actions
20
+
FROM
21
+
? AS rc
22
+
INNER JOIN ? AS a ON rc.rc_actor = a.actor_id
23
+
// Conditions below added for consistency with Wikidata: https://phabricator.wikimedia.org/diffusion/ADES/browse/master/src/wikidata/site_stats/sql/active_user_changes.sql
24
+
AND a.actor_user != 0
25
+
AND rc.rc_bot = 0
26
+
AND ( rc.rc_log_type != 'newusers' OR rc.rc_log_type IS NULL)
0 commit comments