Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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