示例#1
0
def test_public_graphite_url():
    rr = Reactor(graphite_url='http://localhost', public_graphite_url=None)
    rr.reinit()
    assert rr.options.get("public_graphite_url") == 'http://localhost'

    rr.reinit(public_graphite_url="http://public")
    assert rr.options.get("public_graphite_url") == "http://public"
示例#2
0
def test_public_graphite_url():
    rr = Reactor(graphite_url='http://localhost', public_graphite_url=None)
    rr.reinit()
    assert rr.options.get("public_graphite_url") == 'http://localhost'

    rr.reinit(public_graphite_url="http://public")
    assert rr.options.get("public_graphite_url") == "http://public"
示例#3
0
def test_reactor():
    from graphite_beacon.core import Reactor

    rr = Reactor()
    assert rr
    assert rr.reinit()

    rr = Reactor(include=['example-config.json'], alerts=[
        {'name': 'test', 'query': '*', 'rules': ["normal: == 0"]}])
    assert rr.options['interval'] == '20minute'
    assert len(rr.alerts) == 2
示例#4
0
def test_reactor():
    rr = Reactor()
    assert rr
    assert rr.reinit()

    rr = Reactor(include=['examples/example-config.json'], alerts=[
        {'name': 'test', 'query': '*', 'rules': ["normal: == 0"]}])
    assert rr.options['interval'] == '20minute'
    assert len(rr.alerts) == 3

    rr = Reactor(include=['examples/example-config.yml'], alerts=[
        {'name': 'test', 'query': '*', 'rules': ["normal: == 0"]}])
    assert rr.options['interval'] == '20minute'
    assert len(rr.alerts) == 3
示例#5
0
def test_reactor():
    from graphite_beacon.core import Reactor

    rr = Reactor()
    assert rr
    assert rr.reinit()

    rr = Reactor(include=['example-config.json'],
                 alerts=[{
                     'name': 'test',
                     'query': '*',
                     'rules': ["normal: == 0"]
                 }])
    assert rr.options['interval'] == '20minute'
    assert len(rr.alerts) == 2
示例#6
0
def test_reactor():
    rr = Reactor()
    assert rr
    assert rr.reinit()

    rr = Reactor(include=['examples/example-config.json'],
                 alerts=[{
                     'name': 'test',
                     'query': '*',
                     'rules': ["normal: == 0"]
                 }])
    assert rr.options['interval'] == '20minute'
    assert len(rr.alerts) == 3

    rr = Reactor(include=['examples/example-config.yml'],
                 alerts=[{
                     'name': 'test',
                     'query': '*',
                     'rules': ["normal: == 0"]
                 }])
    assert rr.options['interval'] == '20minute'
    assert len(rr.alerts) == 3