forked from graphite-project/carbonate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial backport of graphite-project#56
ah lgtm is wrong here migrating to monkeypatching lgtm is wrong here default relay method style fixes fix linting init tests different aggregation_rules init Adding gitignore Fixing tests Adding new pythons Adding new pythons
- Loading branch information
Showing
15 changed files
with
170 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
carbon | ||
whisper | ||
carbon>=1.0.2 | ||
whisper>=0.9.10 | ||
scandir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<env>.applications.<app>.all.requests (60) = sum <env>.applications.<app>.*.requests | ||
<env>.applications.<app>.all.latency (60) = avg <env>.applications.<app>.*.latency | ||
<env>.a.<app> (60) = avg <env>.a.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import unittest | ||
|
||
import carbonate.sieve | ||
from carbonate.lookup import lookup | ||
|
||
from carbonate.cluster import Cluster | ||
from carbonate.config import Config | ||
|
||
|
||
class AggLookupSieveTest(unittest.TestCase): | ||
|
||
def setUp(self): | ||
config_file = "tests/conf/realistic.conf" | ||
agg_rules_file = "test/conf/aggregation-rules.conf" | ||
config = Config(config_file) | ||
self.cluster = Cluster(config, cluster='agg', aggregation_rules=agg_rules_file) | ||
|
||
# testing all aggregation hash tests in one go, | ||
# otherwise it clashes on reading rules file in twisted | ||
def test_sieve_lookup_agg(self): | ||
inputs = ['metric.a.100', | ||
'metric.a.101', | ||
'metric.a.102', | ||
'metric.a.103', | ||
'metric.a.104', | ||
'metric.a.105', | ||
'metric.a.106', | ||
'metric.a.107', | ||
'metric.a.108', | ||
'metric.a.109'] | ||
|
||
node = '1.1.1.1' | ||
node_long = '1.1.1.1:2003:0' | ||
output = ['metric.a.100', | ||
'metric.a.104', | ||
'metric.a.105', | ||
'metric.a.106', | ||
'metric.a.107'] | ||
|
||
node2 = '2.2.2.2' | ||
node2_long = '2.2.2.2:2003:0' | ||
output2 = ['metric.a.101', | ||
'metric.a.102', | ||
'metric.a.103', | ||
'metric.a.108', | ||
'metric.a.109'] | ||
|
||
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster)) | ||
self.assertEqual(f, output) | ||
f = list(carbonate.sieve.filterMetrics(inputs, node_long, self.cluster)) | ||
self.assertEqual(f, output) | ||
|
||
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster)) | ||
self.assertEqual(f, output2) | ||
f = list(carbonate.sieve.filterMetrics(inputs, node2_long, self.cluster)) | ||
self.assertEqual(f, output2) | ||
|
||
f = list(carbonate.sieve.filterMetrics(inputs, node, self.cluster, True)) | ||
self.assertEqual(f, output2) | ||
|
||
f = list(carbonate.sieve.filterMetrics(inputs, node2, self.cluster, True)) | ||
self.assertEqual(f, output) | ||
|
||
f = lookup('metric.a.one', self.cluster) | ||
self.assertEqual(f, ['2.2.2.2:2003:0']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
[tox] | ||
envlist = py27,py27-pre0_9_10,lint,py3 | ||
envlist = py27,py3,pypy,lint | ||
|
||
[testenv] | ||
install_command = pip install --install-option='--install-scripts={envbindir}' --install-option='--install-lib={envsitepackagesdir}' --install-option='--install-data={envdir}/lib/graphite' -r{toxinidir}/requirements.txt -r{toxinidir}/tests/requirements.txt --pre {opts} {packages} | ||
install_command = pip install --prefix={envdir} -r{toxinidir}/requirements.txt -r{toxinidir}/tests/requirements.txt --pre {opts} {packages} | ||
commands = coverage erase | ||
coverage run {envbindir}/nosetests | ||
coverage report --include=carbonate* --omit=*test* | ||
|
||
[testenv:py27-pre0_9_10] | ||
install_command = pip install --install-option='--install-scripts={envbindir}' --install-option='--install-lib={envsitepackagesdir}' --install-option='--install-data={envdir}/lib/graphite' -r{toxinidir}/tests/old_whisper_requirements.txt -r{toxinidir}/tests/requirements.txt --pre {opts} {packages} | ||
basepython = python2.7 | ||
|
||
[testenv:lint] | ||
basepython = python | ||
commands = flake8 carbonate |