From aefb98858dd6184f3fcef1295a3d52f8f2fa2b4a Mon Sep 17 00:00:00 2001 From: Ralph Meijer Date: Wed, 7 Mar 2018 13:56:12 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Prepare=20for=20V=C3=B6r=2018.0.0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AUTHORS | 1 - LICENSE | 2 +- MANIFEST.in | 2 ++ NEWS.rst | 22 ++++++++++++ README.md | 36 ------------------- README.rst | 63 ++++++++++++++++++++++++++++++++++ pyproject.toml | 29 ++++++++++++++++ setup.py | 37 ++++++++++++++++---- vor/__init__.py | 11 ++++++ vor/_version.py | 4 +++ vor/newsfragments/1.feature | 1 + vor/newsfragments/2.feature | 1 + vor/newsfragments/4.feature | 1 + vor/newsfragments/5.feature | 1 + vor/newsfragments/6.feature | 1 + vor/newsfragments/7.feature | 1 + vor/newsfragments/8.bugfix | 1 + vor/newsfragments/9.feature | 1 + vor/test/test_elasticsearch.py | 12 +++---- 19 files changed, 176 insertions(+), 51 deletions(-) delete mode 100644 AUTHORS create mode 100644 MANIFEST.in create mode 100644 NEWS.rst delete mode 100644 README.md create mode 100644 README.rst create mode 100644 pyproject.toml create mode 100644 vor/_version.py create mode 100644 vor/newsfragments/1.feature create mode 100644 vor/newsfragments/2.feature create mode 100644 vor/newsfragments/4.feature create mode 100644 vor/newsfragments/5.feature create mode 120000 vor/newsfragments/6.feature create mode 120000 vor/newsfragments/7.feature create mode 100644 vor/newsfragments/8.bugfix create mode 100644 vor/newsfragments/9.feature diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 83a4d84..0000000 --- a/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Ralph Meijer diff --git a/LICENSE b/LICENSE index abd7855..394ed0b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2014 +Copyright (c) 2012-2018 Mochi Media, Inc. Rackspace Hosting, Inc. Ralph Meijer diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..6cc7c1d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include NEWS.rst +include LICENSE diff --git a/NEWS.rst b/NEWS.rst new file mode 100644 index 0000000..3f9ab88 --- /dev/null +++ b/NEWS.rst @@ -0,0 +1,22 @@ +News +==== + +This project uses `CalVer `_ with a strict backwards +compatibility policy. The third digit is only for regressions. + +Changes for the upcoming release can be found in the `vor/newsfragments` +directory. + +.. + Do *NOT* add changelog entries here! + + This changelog is managed by towncrier and is compiled at release time from + the news fragments directory. + +.. towncrier release notes start + + +0.0.1 (2014-02-10) +================== + +First release diff --git a/README.md b/README.md deleted file mode 100644 index 6b6dacd..0000000 --- a/README.md +++ /dev/null @@ -1,36 +0,0 @@ -Vör ---- - -[![Build Status](https://travis-ci.org/mochi/vor.png?branch=master)](https://travis-ci.org/mochi/vor) - - -What is this? -============= - -Vör is a set of services for gathering metrics by polling systems and -delivering them to graphite. - -Currently there is support for polling metrics from Elasticsearch and Redis. - - -Requirements -============ - - - Twisted - - simplejson - - txredis - - -Copyright and Warranty -====================== - -The code in this distribution started as an internal tool at Mochi Media and -is made available under the MIT License. See the included LICENSE file for -details. - - -Name -==== - -In Norse mythology, Vör is a goddess associated with wisdom. She is described -as "wise and inquiring, so that nothing can be concealed from her". diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..9c790fe --- /dev/null +++ b/README.rst @@ -0,0 +1,63 @@ +Vör +=== + +|pypi| +|travis| + + +What is this? +------------- + +Vör is a set of services for gathering metrics by polling systems and +delivering them to graphite. + +Currently there is support for polling metrics from Elasticsearch and Redis. + + +Requirements +------------ + +- Python 2.7 or pypy equivalent +- Twisted 16.0.0 or later +- incremental 16.9.0 or later +- treq 16.20.0 or later for Elasticsearch support +- txredis for Redis support +- pybeanstalk for Beanstalk support + + +Copyright and Warranty +---------------------- + +The code in this distribution started as an internal tool at Mochi Media and +is made available under the MIT License. See the included `LICENSE `_ +file for details. + + +Contributors +------------ + +- Christopher Zorn +- Zack Dever +- Dana Powers + + +Author +------ + +Ralph Meijer + + + + +Name +---- + +In Norse mythology, Vör is a goddess associated with wisdom. She is described +as "wise and inquiring, so that nothing can be concealed from her". + + +.. |pypi| image:: http://img.shields.io/pypi/v/vor.svg +.. _pypi: https://pypi.python.org/pypi/vor + +.. |travis| image:: https://travis-ci.org/mochi/vor.svg?branch=master +.. _travis: https://travis-ci.org/mochi/vor diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5ad14c8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[tool.towncrier] + package = "vor" + package_dir = "." + filename = "NEWS.rst" + + [[tool.towncrier.type]] + directory = "feature" + name = "Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Fixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Improved Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "removal" + name = "Deprecations and Removals" + showcontent = true + + [[tool.towncrier.type]] + directory = "misc" + name = "Misc" + showcontent = false diff --git a/setup.py b/setup.py index ca22d01..236a123 100755 --- a/setup.py +++ b/setup.py @@ -2,25 +2,48 @@ from setuptools import setup +with open('README.rst', 'r') as f: + long_description = f.read() + setup(name='vor', - version='0.0.1', - description='Services for gatheric metrics to send to Graphite', + description='Services for gathering metrics to send to Graphite', + long_description=long_description, maintainer='Ralph Meijer', maintainer_email='ralphm@ik.nu', url='http://github.com/ralphm/vor', license='MIT', platforms='any', + classifiers=[ + 'Programming Language :: Python :: 2.7', + ], packages=[ 'vor', 'vor.test', ], zip_safe=False, + setup_requires=[ + 'incremental>=16.9.0', + ], + use_incremental=True, install_requires=[ + 'incremental>=16.9.0', 'Twisted[tls] >= 16.0.0', - 'simplejson', - 'txredis', - 'pyyaml', - 'pybeanstalk', - 'treq >= 16.12.0', ], + extras_require={ + 'elasticsearch': [ + 'treq >= 16.12.0', + ], + 'redis': [ + 'txredis', + ], + 'beanstalk': [ + 'pyyaml', + 'pybeanstalk', + ], + 'dev': [ + 'pyflakes', + 'coverage', + 'towncrier', + ], + }, ) diff --git a/vor/__init__.py b/vor/__init__.py index e69de29..b405146 100644 --- a/vor/__init__.py +++ b/vor/__init__.py @@ -0,0 +1,11 @@ +""" +Wokkel. + +Support library for Twisted applications using XMPP protocols. +""" + +from vor._version import __version__ as _incremental_version + +__version__ = _incremental_version.public() + +__all__ = ["__version__"] diff --git a/vor/_version.py b/vor/_version.py new file mode 100644 index 0000000..cde8e9f --- /dev/null +++ b/vor/_version.py @@ -0,0 +1,4 @@ +from incremental import Version + +__version__ = Version("vor", 18, 0, 0, release_candidate=1) +__all__ = ["__version__"] diff --git a/vor/newsfragments/1.feature b/vor/newsfragments/1.feature new file mode 100644 index 0000000..a8a8a31 --- /dev/null +++ b/vor/newsfragments/1.feature @@ -0,0 +1 @@ +vor.elasticsearch now supports the Elasticsearch 1.0 API diff --git a/vor/newsfragments/2.feature b/vor/newsfragments/2.feature new file mode 100644 index 0000000..a3adc02 --- /dev/null +++ b/vor/newsfragments/2.feature @@ -0,0 +1 @@ +The new module vor.beanstalk adds support for Beanstalk stats. diff --git a/vor/newsfragments/4.feature b/vor/newsfragments/4.feature new file mode 100644 index 0000000..a08a3c3 --- /dev/null +++ b/vor/newsfragments/4.feature @@ -0,0 +1 @@ +vor.elasticsearch.ElasticSearchNodeStatsGraphiteService now has a boolean `hostname_only` parameter to strip the domain off the node's name. diff --git a/vor/newsfragments/5.feature b/vor/newsfragments/5.feature new file mode 100644 index 0000000..7936086 --- /dev/null +++ b/vor/newsfragments/5.feature @@ -0,0 +1 @@ +The new vor.kafka module adds support for Kafka Consumer Offset polling. diff --git a/vor/newsfragments/6.feature b/vor/newsfragments/6.feature new file mode 120000 index 0000000..d71dba1 --- /dev/null +++ b/vor/newsfragments/6.feature @@ -0,0 +1 @@ +4.feature \ No newline at end of file diff --git a/vor/newsfragments/7.feature b/vor/newsfragments/7.feature new file mode 120000 index 0000000..f12d7c6 --- /dev/null +++ b/vor/newsfragments/7.feature @@ -0,0 +1 @@ +9.feature \ No newline at end of file diff --git a/vor/newsfragments/8.bugfix b/vor/newsfragments/8.bugfix new file mode 100644 index 0000000..cfadb68 --- /dev/null +++ b/vor/newsfragments/8.bugfix @@ -0,0 +1 @@ +vor.elasticsearch pollers now remove spaces from metric names. diff --git a/vor/newsfragments/9.feature b/vor/newsfragments/9.feature new file mode 100644 index 0000000..e30cb82 --- /dev/null +++ b/vor/newsfragments/9.feature @@ -0,0 +1 @@ +The new vor.elasticsearch.ElasticSearchIndicesStatsGraphiteService provides a poller for the Indices Stats API. diff --git a/vor/test/test_elasticsearch.py b/vor/test/test_elasticsearch.py index 8c353c9..aca4ef9 100644 --- a/vor/test/test_elasticsearch.py +++ b/vor/test/test_elasticsearch.py @@ -1,4 +1,4 @@ -import simplejson +import json import time from twisted.trial import unittest @@ -205,7 +205,7 @@ def setUp(self): }""" - data = simplejson.loads(stats) + data = json.loads(stats) self.collector.flatten(data) self.result = self.collector.protocol.output @@ -1493,8 +1493,8 @@ def setUp(self): }, "cluster_name" : "production" }""" - self.collector.flatten(simplejson.loads(stats)) - self.collector_hostname_only.flatten(simplejson.loads(stats)) + self.collector.flatten(json.loads(stats)) + self.collector_hostname_only.flatten(json.loads(stats)) self.result = self.collector.protocol.output self.result_hostname_only = self.collector_hostname_only.protocol.output @@ -1631,7 +1631,7 @@ def setUp(self): }""" - data = simplejson.loads(stats) + data = json.loads(stats) self.collector.flatten(data) self.result = self.collector.protocol.output @@ -1666,7 +1666,7 @@ def test_statusYellow(self): For status yellow to other metrics are 0. """ stats = """{"status": "yellow"}""" - data = simplejson.loads(stats) + data = json.loads(stats) self.collector.flatten(data) self.result = self.collector.protocol.output From deec46e443e5ad3ba19b19bd07a28cb5e4cefec6 Mon Sep 17 00:00:00 2001 From: Ralph Meijer Date: Wed, 7 Mar 2018 13:57:33 +0100 Subject: [PATCH 2/3] Process news fragements with towncrier for rc1 --- NEWS.rst | 22 ++++++++++++++++++++++ vor/newsfragments/1.feature | 1 - vor/newsfragments/10.feature | 1 - vor/newsfragments/2.feature | 1 - vor/newsfragments/4.feature | 1 - vor/newsfragments/5.feature | 1 - vor/newsfragments/6.feature | 1 - vor/newsfragments/7.feature | 1 - vor/newsfragments/8.bugfix | 1 - vor/newsfragments/9.feature | 1 - 10 files changed, 22 insertions(+), 9 deletions(-) delete mode 100644 vor/newsfragments/1.feature delete mode 100644 vor/newsfragments/10.feature delete mode 100644 vor/newsfragments/2.feature delete mode 100644 vor/newsfragments/4.feature delete mode 100644 vor/newsfragments/5.feature delete mode 120000 vor/newsfragments/6.feature delete mode 120000 vor/newsfragments/7.feature delete mode 100644 vor/newsfragments/8.bugfix delete mode 100644 vor/newsfragments/9.feature diff --git a/NEWS.rst b/NEWS.rst index 3f9ab88..96b6157 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -15,6 +15,28 @@ directory. .. towncrier release notes start +Vor 18.0.0rc1 (2018-03-07) +========================== + +Features +-------- + +- vor.elasticsearch now supports the Elasticsearch 1.0 API (#1) +- The new module vor.beanstalk adds support for Beanstalk stats. (#2) +- vor.elasticsearch.ElasticSearchNodeStatsGraphiteService now has a boolean + `hostname_only` parameter to strip the domain off the node's name. (#4, #6) +- The new vor.kafka module adds support for Kafka Consumer Offset polling. (#5) +- The new vor.elasticsearch.ElasticSearchIndicesStatsGraphiteService provides a + poller for the Indices Stats API. (#7, #9) +- vor.elasticsearch now supports basic authentication and (non-validated) https + for its pollers. (#10) + + +Fixes +----- + +- vor.elasticsearch pollers now remove spaces from metric names. (#8) + 0.0.1 (2014-02-10) ================== diff --git a/vor/newsfragments/1.feature b/vor/newsfragments/1.feature deleted file mode 100644 index a8a8a31..0000000 --- a/vor/newsfragments/1.feature +++ /dev/null @@ -1 +0,0 @@ -vor.elasticsearch now supports the Elasticsearch 1.0 API diff --git a/vor/newsfragments/10.feature b/vor/newsfragments/10.feature deleted file mode 100644 index 14959e6..0000000 --- a/vor/newsfragments/10.feature +++ /dev/null @@ -1 +0,0 @@ -vor.elasticsearch now supports basic authentication and (non-validated) https for its pollers. diff --git a/vor/newsfragments/2.feature b/vor/newsfragments/2.feature deleted file mode 100644 index a3adc02..0000000 --- a/vor/newsfragments/2.feature +++ /dev/null @@ -1 +0,0 @@ -The new module vor.beanstalk adds support for Beanstalk stats. diff --git a/vor/newsfragments/4.feature b/vor/newsfragments/4.feature deleted file mode 100644 index a08a3c3..0000000 --- a/vor/newsfragments/4.feature +++ /dev/null @@ -1 +0,0 @@ -vor.elasticsearch.ElasticSearchNodeStatsGraphiteService now has a boolean `hostname_only` parameter to strip the domain off the node's name. diff --git a/vor/newsfragments/5.feature b/vor/newsfragments/5.feature deleted file mode 100644 index 7936086..0000000 --- a/vor/newsfragments/5.feature +++ /dev/null @@ -1 +0,0 @@ -The new vor.kafka module adds support for Kafka Consumer Offset polling. diff --git a/vor/newsfragments/6.feature b/vor/newsfragments/6.feature deleted file mode 120000 index d71dba1..0000000 --- a/vor/newsfragments/6.feature +++ /dev/null @@ -1 +0,0 @@ -4.feature \ No newline at end of file diff --git a/vor/newsfragments/7.feature b/vor/newsfragments/7.feature deleted file mode 120000 index f12d7c6..0000000 --- a/vor/newsfragments/7.feature +++ /dev/null @@ -1 +0,0 @@ -9.feature \ No newline at end of file diff --git a/vor/newsfragments/8.bugfix b/vor/newsfragments/8.bugfix deleted file mode 100644 index cfadb68..0000000 --- a/vor/newsfragments/8.bugfix +++ /dev/null @@ -1 +0,0 @@ -vor.elasticsearch pollers now remove spaces from metric names. diff --git a/vor/newsfragments/9.feature b/vor/newsfragments/9.feature deleted file mode 100644 index e30cb82..0000000 --- a/vor/newsfragments/9.feature +++ /dev/null @@ -1 +0,0 @@ -The new vor.elasticsearch.ElasticSearchIndicesStatsGraphiteService provides a poller for the Indices Stats API. From f8ac5a1da0d243de6559395a9165ae3bb5ca843d Mon Sep 17 00:00:00 2001 From: Ralph Meijer Date: Wed, 7 Mar 2018 14:04:50 +0100 Subject: [PATCH 3/3] Make sure all dependencies are there for Travis CI --- .travis.yml | 3 +-- setup.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c2806f..84f5c5a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,8 @@ env: - TWISTED=Twisted==17.9.0 install: - - pip install pyflakes - pip install -q $TWISTED - - pip install . + - pip install .[dev,beanstalk,elasticsearch,redis] script: - pyflakes vor diff --git a/setup.py b/setup.py index 236a123..98c0fa5 100755 --- a/setup.py +++ b/setup.py @@ -37,7 +37,6 @@ 'txredis', ], 'beanstalk': [ - 'pyyaml', 'pybeanstalk', ], 'dev': [