Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #24 from krismolendyke/df-complex
Browse files Browse the repository at this point in the history
collectd - Update df metric re to select complex.
  • Loading branch information
krismolendyke committed Feb 14, 2015
2 parents e91b5c6 + 4ad1ece commit 1f9891e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
8 changes: 8 additions & 0 deletions HISTORY.rst
@@ -1,6 +1,14 @@
Release History
---------------

0.0.22 (2015-02-14)
+++++++++++++++++++

**Bug fixes**

- Avoid selecting ``df`` metrics other than ``df_complex`` when creating disk
free graphs.

0.0.21 (2015-01-29)
+++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion circonus/__init__.py
@@ -1,5 +1,5 @@
__title__ = "circonus"
__version__ = "0.0.21"
__version__ = "0.0.22"

from logging import NullHandler

Expand Down
5 changes: 3 additions & 2 deletions circonus/collectd/df.py
Expand Up @@ -28,8 +28,9 @@

DF_METRIC_RE = re.compile(r"""
^df # Starts with "df"
`.*` # Anything in between
({}|{}|{})$ # Ends with defined suffix
`.* # Has a mount directory
`df_complex # Is a complex metric
`({}|{}|{})$ # Ends with defined suffix
""".format(*DF_METRIC_SUFFIXES), re.X)
"""A compiled regular expression which matches ``collectd`` metrics."""

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -12,7 +12,7 @@

setup(
name="circonus",
version="0.0.21",
version="0.0.22",
description="Interact with the Circonus REST API.",
long_description=readme + "\n\n" + history,
author="Monetate Inc.",
Expand Down
12 changes: 11 additions & 1 deletion test_circonus.py
Expand Up @@ -58,6 +58,15 @@
{"name": "df`mnt-mysql`df_complex`reserved",
"status": "active",
"type": "numeric"},
{"name": "df`mnt-mysql`percent_bytes`used",
"status": "active",
"type": "numeric"},
{"name": "df`mnt-mysql`percent_bytes`free",
"status": "active",
"type": "numeric"},
{"name": "df`mnt-mysql`percent_bytes`reserved",
"status": "active",
"type": "numeric"},
{"name": "df`mnt-solr-home`df_complex`free",
"status": "active",
"type": "numeric"},
Expand Down Expand Up @@ -1340,8 +1349,9 @@ def test_get_df_metrics(self):
self.assertItemsEqual(expected, actual)

expected = [m for m in check_bundle["metrics"] if m["name"].startswith("df`")]
expected = [m for m in expected if "`mnt-mysql`" in m["name"]]
expected = [m for m in expected if "`mnt-mysql`" in m["name"] and "`df_complex" in m["name"]]
actual = df.get_df_metrics(check_bundle["metrics"], "mnt/mysql")
self.assertEqual(3, len(actual))
self.assertItemsEqual(expected, actual)
actual = df.get_df_metrics(check_bundle["metrics"], "/mnt/mysql")
self.assertItemsEqual(expected, actual)
Expand Down

0 comments on commit 1f9891e

Please sign in to comment.