Exemplo n.º 1
0
#         Author:  Ayush Dubey, [email protected]
#
# Copyright (C) 2013, Cornell University, see the LICENSE file
#                     for licensing agreement
# ===============================================================
#

import sys

import weaver.client as client
import time
from test_base import test_graph

# creating line graph
nodes = []
num_nodes = 2000
num_clients = 1
clients = []
for i in range(num_clients):
    clients.append(client.Client(client._CLIENT_ID + i, i % client._NUM_VTS))
print 'Created client'
start = time.time()
tg = test_graph(clients, num_nodes, 2 * num_nodes)
print 'Node = ' + str(tg.nodes[0])
print 'Edge to del = ' + str(tg.edge_handles[tg.nodes[0]][0])
tx_id = clients[0].begin_tx()
clients[0].delete_edge(tx_id, tg.edge_handles[tg.nodes[0]][0], tg.nodes[0])
clients[0].end_tx(tx_id)
end = time.time()
print 'Created graph in ' + str(end - start) + ' seconds'
Exemplo n.º 2
0
        sys.stdout.write('.')
        sys.stdout.flush()
    print ' done'
    end = time.time()
    return (end-start)


coord_id = 0
c_list = []
c_list.append(client.Client(client._CLIENT_ID, coord_id))
c_list.append(client.Client(client._CLIENT_ID + 1, coord_id))
c_list.append(client.Client(client._CLIENT_ID + 2, coord_id))
sc = simple_client.simple_client(c_list[0])

reqs = []
random.seed(42)
g = test_base.test_graph(c_list, num_nodes, 2*num_nodes, seed = 42)

for _ in range(num_dests):
    dest = random.choice(g.nodes)
    for _ in range(requests_per_dest):
        reqs.append((random.choice(g.nodes), dest))

print "starting traversals"

t = exec_traversals(reqs, sc, False)
print "time taken for " + str(num_dests * requests_per_dest) + " random reachability requests over " + str(num_nodes) + " nodes was: " + str(t)

t = exec_traversals(reqs, sc, True)
print "time taken for " + str(num_dests * requests_per_dest) + " random reachability requests with hot caching over " + str(num_nodes) + " nodes was: " + str(t)
Exemplo n.º 3
0
#         Author:  Ayush Dubey, [email protected]
# 
# Copyright (C) 2013, Cornell University, see the LICENSE file
#                     for licensing agreement
# ===============================================================
# 

import sys

import weaver.client as client
import time
from test_base import test_graph

# creating line graph
nodes = []
num_nodes = 2000
num_clients = 1
clients = []
for i in range(num_clients):
    clients.append(client.Client(client._CLIENT_ID+i, i % client._NUM_VTS))
print 'Created client'
start = time.time()
tg = test_graph(clients, num_nodes, 2*num_nodes)
print 'Node = ' + str(tg.nodes[0])
print 'Edge to del = ' + str(tg.edge_handles[tg.nodes[0]][0])
tx_id = clients[0].begin_tx()
clients[0].delete_edge(tx_id, tg.edge_handles[tg.nodes[0]][0], tg.nodes[0])
clients[0].end_tx(tx_id)
end = time.time()
print 'Created graph in ' + str(end-start) + ' seconds'