[MediaWiki-commits] [Gerrit] Remove all kraken references - change (operations/puppet)

2014-10-23 Thread Ottomata (Code Review)
Ottomata has submitted this change and it was merged.

Change subject: Remove all kraken references
..


Remove all kraken references

The kraken repository (and previously named cluster) have
been deprecated and are no longer supported or used.

Change-Id: I6f2900f2a4643a8fce98b3b637f3dd82ef1d1043
---
D files/ganglia/plugins/kraken_webrequest_loss.py
D files/ganglia/plugins/kraken_webrequest_loss.pyconf
M manifests/misc/monitoring.pp
M manifests/role/analytics.pp
D manifests/role/analytics/kraken.pp
M manifests/role/analytics/refinery.pp
M manifests/role/deployment.pp
M manifests/site.pp
M modules/contint/manifests/packages.pp
9 files changed, 3 insertions(+), 312 deletions(-)

Approvals:
  Ottomata: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/files/ganglia/plugins/kraken_webrequest_loss.py 
b/files/ganglia/plugins/kraken_webrequest_loss.py
deleted file mode 100644
index 8b966a8..000
--- a/files/ganglia/plugins/kraken_webrequest_loss.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-Python Gmond Module for Kraken Webrequest Loss Percentage.
-Loss percentage per source host data is generated by the packetloss
-Oozie job in Kraken.
-
-:copyright: (c) 2012 Wikimedia Foundation
-:author: Andrew Otto o...@wikimedia.org
-:license: GPL
-
-
-from __future__ import print_function
-
-import logging
-import commands
-
-UPDATE_INTERVAL = 3600 # seconds
-
-# Config for multiple metrics.
-# Currently we only compute a single webrequest loss
-# percentage, but this allows us to add more later.
-metrics = {
-'webrequest_loss_average': {
-'description': 'Average Webrequest Loss Percentage',
-'path':'/wmf/data/webrequest/loss',
-}
-}
-
-def latest_loss_path(metric_name):
-Returns HDFS path to the most recently generated webrequest loss 
data.
-logging.debug(latest_loss_path(%s) % metrics[metric_name]['path'])
-return commands.getoutput(/usr/bin/hadoop fs -ls %s | /usr/bin/tail -n 1 
| /usr/bin/awk '{print $NF}' % (metrics[metric_name]['path']))
-
-def loss_data(loss_path):
-Returns the output data inside the HDFS loss_path.
-logging.debug(loss_data(%s) % loss_path)
-return commands.getoutput(/usr/bin/hadoop fs -cat %s/part* % (loss_path))
-
-def loss_average(loss_data):
-Parses loss_data for loss percentages and averages them all.
-logging.debug(loss_average(%s) % loss_data)
-percent_sum = 0.0
-loss_lines = loss_data.split(\n)
-for line in loss_lines:
-fields = line.split(\t)
-percent = fields[-1]
-percent_sum += float(percent)
-
-average_percent = (percent_sum / float(len(loss_lines)))
-return average_percent
-
-def metric_handler(name):
-Get value of particular metric; part of Gmond interface
-logging.debug('metric_handler(): %s', name)
-return loss_average(loss_data(latest_loss_path(name)))
-
-def metric_init(params):
-global descriptors
-
-descriptors = []
-for metric_name, metric_config in metrics.items():
-descriptors.append({
-'name': metric_name,
-'call_back': metric_handler,
-'time_max': 3660,
-'value_type': 'float',
-'units': '%',
-'slope': 'both',
-'format': '%f',
-'description': metric_config['description'],
-'groups': 'analytics'
-})
-
-return descriptors
-
-
-def metric_cleanup():
-Teardown; part of Gmond interface
-pass
-
-
-if __name__ == '__main__':
-# When invoked as standalone script, run a self-test by querying each
-# metric descriptor and printing it out.
-logging.basicConfig(level=logging.DEBUG)
-for metric in metric_init({}):
-value = metric['call_back'](metric['name'])
-print(( %s =  + metric['format'] ) % ( metric['name'], value ))
diff --git a/files/ganglia/plugins/kraken_webrequest_loss.pyconf 
b/files/ganglia/plugins/kraken_webrequest_loss.pyconf
deleted file mode 100644
index 2ea2fea..000
--- a/files/ganglia/plugins/kraken_webrequest_loss.pyconf
+++ /dev/null
@@ -1,20 +0,0 @@
-# Gmond configuration for calculating
-# webrequest data loss stored in HDFS in Kraken.
-
-modules {
-  module {
-name = kraken_webrequest_loss
-language = python
-  }
-}
-
-collection_group {
-  collect_every = 3600
-  time_threshold = 3660
-
-  metric {
-name = webrequest_loss_average
-title = Average Loss Percentage
-value_threshold = 0
-  }
-}
diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp
index b4fa29b..e27147a 100644
--- a/manifests/misc/monitoring.pp
+++ b/manifests/misc/monitoring.pp
@@ -64,37 +64,6 @@
 }
 }
 
-# == Class misc::monitoring::kraken::loss
-# Checks recently generated webrequest loss statistics in
-# Kraken HDFS and sends the average loss percentage to ganglia.
-#
-class misc::monitoring::kraken::loss 

[MediaWiki-commits] [Gerrit] Remove all kraken references - change (operations/puppet)

2014-10-22 Thread Ottomata (Code Review)
Ottomata has uploaded a new change for review.

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

Change subject: Remove all kraken references
..

Remove all kraken references

The kraken repository (and previously named cluster) have
been deprecated and are no longer supported or used.

Change-Id: I6f2900f2a4643a8fce98b3b637f3dd82ef1d1043
---
D files/ganglia/plugins/kraken_webrequest_loss.py
D files/ganglia/plugins/kraken_webrequest_loss.pyconf
M manifests/misc/monitoring.pp
M manifests/role/analytics.pp
D manifests/role/analytics/kraken.pp
M manifests/role/analytics/refinery.pp
M manifests/role/deployment.pp
M manifests/site.pp
M modules/contint/manifests/packages.pp
9 files changed, 3 insertions(+), 312 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/47/168147/1

diff --git a/files/ganglia/plugins/kraken_webrequest_loss.py 
b/files/ganglia/plugins/kraken_webrequest_loss.py
deleted file mode 100644
index 8b966a8..000
--- a/files/ganglia/plugins/kraken_webrequest_loss.py
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-Python Gmond Module for Kraken Webrequest Loss Percentage.
-Loss percentage per source host data is generated by the packetloss
-Oozie job in Kraken.
-
-:copyright: (c) 2012 Wikimedia Foundation
-:author: Andrew Otto o...@wikimedia.org
-:license: GPL
-
-
-from __future__ import print_function
-
-import logging
-import commands
-
-UPDATE_INTERVAL = 3600 # seconds
-
-# Config for multiple metrics.
-# Currently we only compute a single webrequest loss
-# percentage, but this allows us to add more later.
-metrics = {
-'webrequest_loss_average': {
-'description': 'Average Webrequest Loss Percentage',
-'path':'/wmf/data/webrequest/loss',
-}
-}
-
-def latest_loss_path(metric_name):
-Returns HDFS path to the most recently generated webrequest loss 
data.
-logging.debug(latest_loss_path(%s) % metrics[metric_name]['path'])
-return commands.getoutput(/usr/bin/hadoop fs -ls %s | /usr/bin/tail -n 1 
| /usr/bin/awk '{print $NF}' % (metrics[metric_name]['path']))
-
-def loss_data(loss_path):
-Returns the output data inside the HDFS loss_path.
-logging.debug(loss_data(%s) % loss_path)
-return commands.getoutput(/usr/bin/hadoop fs -cat %s/part* % (loss_path))
-
-def loss_average(loss_data):
-Parses loss_data for loss percentages and averages them all.
-logging.debug(loss_average(%s) % loss_data)
-percent_sum = 0.0
-loss_lines = loss_data.split(\n)
-for line in loss_lines:
-fields = line.split(\t)
-percent = fields[-1]
-percent_sum += float(percent)
-
-average_percent = (percent_sum / float(len(loss_lines)))
-return average_percent
-
-def metric_handler(name):
-Get value of particular metric; part of Gmond interface
-logging.debug('metric_handler(): %s', name)
-return loss_average(loss_data(latest_loss_path(name)))
-
-def metric_init(params):
-global descriptors
-
-descriptors = []
-for metric_name, metric_config in metrics.items():
-descriptors.append({
-'name': metric_name,
-'call_back': metric_handler,
-'time_max': 3660,
-'value_type': 'float',
-'units': '%',
-'slope': 'both',
-'format': '%f',
-'description': metric_config['description'],
-'groups': 'analytics'
-})
-
-return descriptors
-
-
-def metric_cleanup():
-Teardown; part of Gmond interface
-pass
-
-
-if __name__ == '__main__':
-# When invoked as standalone script, run a self-test by querying each
-# metric descriptor and printing it out.
-logging.basicConfig(level=logging.DEBUG)
-for metric in metric_init({}):
-value = metric['call_back'](metric['name'])
-print(( %s =  + metric['format'] ) % ( metric['name'], value ))
diff --git a/files/ganglia/plugins/kraken_webrequest_loss.pyconf 
b/files/ganglia/plugins/kraken_webrequest_loss.pyconf
deleted file mode 100644
index 2ea2fea..000
--- a/files/ganglia/plugins/kraken_webrequest_loss.pyconf
+++ /dev/null
@@ -1,20 +0,0 @@
-# Gmond configuration for calculating
-# webrequest data loss stored in HDFS in Kraken.
-
-modules {
-  module {
-name = kraken_webrequest_loss
-language = python
-  }
-}
-
-collection_group {
-  collect_every = 3600
-  time_threshold = 3660
-
-  metric {
-name = webrequest_loss_average
-title = Average Loss Percentage
-value_threshold = 0
-  }
-}
diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp
index b4fa29b..e27147a 100644
--- a/manifests/misc/monitoring.pp
+++ b/manifests/misc/monitoring.pp
@@ -64,37 +64,6 @@
 }
 }
 
-# == Class misc::monitoring::kraken::loss
-# Checks recently generated webrequest loss statistics in
-# Kraken HDFS and sends the average loss percentage to