Example #1
0
def main():
    rc = RiemannClient()
    rc.send({
        'host': '127.0.0.1',
        'service': 'www',
        'state': 'down',
        'metric_f': 10000
    })
    res = rc.query('host')
    print res
    for e in res.events:
        print e.host
Example #2
0
def main():
    rc = RiemannClient()
    tb = time.time()

    for n in xrange(100):
        rc.send({'host':'127.0.0.1', 'service': 'www%d' % n, 'state': 'down', 'metric_f': 10000})
    
    print time.time() - tb

    res = rc.query('service')
    print res
    if res is not None:
        for e in res.events: print e.host
Example #3
0
def main():
    rc = RiemannClient()
    tb = time.time()

    for n in xrange(100):
        rc.send({
            'host': '127.0.0.1',
            'service': 'www%d' % n,
            'state': 'down',
            'metric_f': 10000
        })

    print time.time() - tb

    res = rc.query('service')
    print res
    if res is not None:
        for e in res.events:
            print e.host
Example #4
0
def main():
    rc = RiemannClient()
    rc.send({'host':'127.0.0.1', 'service': 'www', 'state': 'down', 'metric_f': 10000})
    res = rc.query('host')
    print res
    for e in res.events: print e.host