Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/188017

Change subject: puppetmaster: Send cherry-picked commit count stats to statsd
......................................................................

puppetmaster: Send cherry-picked commit count stats to statsd

Bug: T87616
Change-Id: I27708e1e9e8c896b69db140ca7ff49318ea986ee
---
M modules/puppetmaster/manifests/gitsync.pp
M modules/puppetmaster/templates/git-sync-upstream.erb
2 files changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/17/188017/1

diff --git a/modules/puppetmaster/manifests/gitsync.pp 
b/modules/puppetmaster/manifests/gitsync.pp
index 0c366c3..b46e2fe 100644
--- a/modules/puppetmaster/manifests/gitsync.pp
+++ b/modules/puppetmaster/manifests/gitsync.pp
@@ -6,8 +6,11 @@
 #
 # [*repo_path*]
 #   The path to the operations/puppet.git repository
+# [*statsd_host*]
+#   The host to send stats about cherry-picked commits to
 class puppetmaster::gitsync(
-    $repo_path = '/var/lib/git/operations/puppet'
+    $repo_path = '/var/lib/git/operations/puppet',
+    $statsd_host = 'labmon1001.eqiad.wmnet',
 ){
 
     file { '/usr/local/bin/git-sync-upstream':
diff --git a/modules/puppetmaster/templates/git-sync-upstream.erb 
b/modules/puppetmaster/templates/git-sync-upstream.erb
index 403fc86..5402297 100755
--- a/modules/puppetmaster/templates/git-sync-upstream.erb
+++ b/modules/puppetmaster/templates/git-sync-upstream.erb
@@ -73,5 +73,11 @@
 git log --color --pretty=oneline --abbrev-commit origin/HEAD..HEAD |
 sed 's/^/  /'
 
+# Send stats on how many cherry-picked commits there are to statsd
+STATS_PREFIX="`cat /etc/wmflabs-project`.`cat /etc/wmflabs-instancename`"
+CHERRY_PICKED_COUNT=`git log --pretty=oneline --abbrev-commit 
origin/HEAD..HEAD | wc -l`
+echo -n 
"$STATS_PREFIX.puppetmaster.cherrypicked_commits:$CHERRY_PICKED_COUNT|g" |
+    nc -w 1 -u <%= @statsd_host %> 8125
+
 # Restore dirty files if present
 [[ ${HAVE_STASH} -ne 0 ]] && git stash pop

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I27708e1e9e8c896b69db140ca7ff49318ea986ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to