Ejemplo n.º 1
0
from cloudbrain.spacebrew.spacebrew_utils import calculate_spacebrew_name
import time


start = time.time()

# spacebrew router
sp_router = SpacebrewRouter(server=EXPLO_BRAINSERVER_IP)
for path in CASSANDRA_METRICS:

    publisher_metric_name = calculate_spacebrew_name(path)
    for muse_port in MUSE_PORTS:

        subscriber_metric_name = '%s-muse-%s' % (publisher_metric_name, muse_port)

        # route data
        publisher_name = 'muse-%s' % muse_port
        subscriber_name = SPACEBREW_CASSANDRA_NAME

        r = sp_router.link(publisher_metric_name, subscriber_metric_name, publisher_name, subscriber_name,
                            SPACEBREW_BRAINSERVER_IP, SPACEBREW_CASSANDRA_IP)
        print r

        time.sleep(0.1)

end = time.time()

print 'routing took %s s' % (end - start)


Ejemplo n.º 2
0
# todo: remove these lines line
subscriber_name = SPACEBREW_DATA_VIZ_NAME
publisher_ip = '107.170.205.177'
subscriber_ip = '10.0.0.245'
spacebrew_server_ip = '107.170.205.177'

# spacebrew router
sp_router = SpacebrewRouter(server=spacebrew_server_ip)
for path in DATA_VIZ_METRICS:

    publisher_metric_name = calculate_spacebrew_name(path)
    for muse_port in MUSE_PORTS:

        subscriber_metric_name = '%s-muse-%s' % (publisher_metric_name, muse_port)

        # route data FROM the muses
        publisher_name = 'muse-%s' % muse_port

        r = sp_router.link(publisher_metric_name, subscriber_metric_name, publisher_name, subscriber_name,
                            publisher_ip, subscriber_ip)
        print r

        time.sleep(0.1)

end = time.time()

print 'routing took %s s' % (end - start)


Ejemplo n.º 3
0
from cloudbrain.spacebrew.spacebrew_utils import calculate_spacebrew_name
import time

start = time.time()

# spacebrew router
sp_router = SpacebrewRouter(server=EXPLO_BRAINSERVER_IP)
for path in CASSANDRA_METRICS:

    publisher_metric_name = calculate_spacebrew_name(path)
    for muse_port in MUSE_PORTS:

        subscriber_metric_name = '%s-muse-%s' % (publisher_metric_name,
                                                 muse_port)

        # route data
        publisher_name = 'muse-%s' % muse_port
        subscriber_name = SPACEBREW_CASSANDRA_NAME

        r = sp_router.link(publisher_metric_name, subscriber_metric_name,
                           publisher_name, subscriber_name,
                           SPACEBREW_BRAINSERVER_IP, SPACEBREW_CASSANDRA_IP)
        print r

        time.sleep(0.1)

end = time.time()

print 'routing took %s s' % (end - start)