Aklapper has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348238 )

Change subject: Phabricator monthly email: Also include Differential user 
activity
......................................................................

Phabricator monthly email: Also include Differential user activity

Change-Id: I183675e5a4c880cc10f7368fd65d54ae5f79a843
---
M modules/phabricator/templates/community_metrics.sh.erb
1 file changed, 16 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/38/348238/1

diff --git a/modules/phabricator/templates/community_metrics.sh.erb 
b/modules/phabricator/templates/community_metrics.sh.erb
index abcfaf7..95af778 100644
--- a/modules/phabricator/templates/community_metrics.sh.erb
+++ b/modules/phabricator/templates/community_metrics.sh.erb
@@ -14,8 +14,17 @@
 declare sql_name='phabricator_maniphest'
 declare sql_pass='<%= 
scope.lookupvar('passwords::mysql::phabricator::metrics_pass') %>'
 
-#echo "result_activesusers"
-result_activeusers=$(MYSQL_PWD=${sql_pass} /usr/bin/mysql -h $sql_host -u 
$sql_user $sql_name << END
+#echo "result_activedifferentialusers"
+result_activedifferentialusers=$(MYSQL_PWD=${sql_pass} /usr/bin/mysql -h 
$sql_host -u $sql_user phabricator_differential << END
+
+SELECT COUNT(DISTINCT authorPHID) FROM differential_transaction WHERE
+    FROM_UNIXTIME(dateCreated,'%Y%m')=date_format(NOW() - INTERVAL 1 
MONTH,'%Y%m');
+
+END
+)
+
+#echo "result_activemaniphestusers"
+result_activemaniphestusers=$(MYSQL_PWD=${sql_pass} /usr/bin/mysql -h 
$sql_host -u $sql_user $sql_name << END
 
 SELECT COUNT(DISTINCT authorPHID) FROM maniphest_transaction WHERE
     FROM_UNIXTIME(dateCreated,'%Y%m')=date_format(NOW() - INTERVAL 1 
MONTH,'%Y%m');
@@ -137,7 +146,7 @@
 
 accountscreated=$(echo $result_accounts_created | tr -d '\n')
 
-activeusers=$(echo $result_activeusers | cut -d " " -f3)
+activemaniphestusers=$(echo $result_activemaniphestusers | cut -d " " -f3)
 authors=$(echo $result_authors | cut -d " " -f3)
 resolvers=$(echo $result_resolvers | cut -d " " -f3)
 
@@ -180,6 +189,7 @@
 diff_lowest=$((epochnow-mediantasksopen_lowest_epoch))
 mediantasksopen_lowest=$(echo $((diff_lowest/86400)))
 
+activedifferentialusers=$(echo $result_activedifferentialusers | cut -d " " 
-f3)
 
 lastmonth=$(date --date="last month" +%Y-%m)
 
@@ -191,7 +201,7 @@
 This is your automatic monthly Phabricator statistics mail.
 
 Accounts created in (${lastmonth}): ${accountscreated}
-Active users (any activity) in (${lastmonth}): ${activeusers}
+Active Maniphest users (any activity) in (${lastmonth}): 
${activemaniphestusers}
 Task authors in (${lastmonth}): ${authors}
 Users who have closed tasks in (${lastmonth}): ${resolvers}
 
@@ -213,6 +223,8 @@
 
 (How long tasks have been open, not how long they have had that priority)
 
+Active Differential users (any activity) in (${lastmonth}): 
${activedifferentialusers}
+
 TODO: Numbers which refer to closed tasks might not be correct, as
 described in https://phabricator.wikimedia.org/T1003 .
 

-- 
To view, visit https://gerrit.wikimedia.org/r/348238
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I183675e5a4c880cc10f7368fd65d54ae5f79a843
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Aklapper <aklap...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to