压测JMeter进行压测,可以问下这边有具体的增删改查的接口
之前用的是这个封装好的nebula-python包,请问下这边有这个接口嘛?
def main_test():
client = None
try:
space_name = 'textZZZ'
# Get one client
client = GraphClient(connection_pool)
# when connection is broken use the following space to set the current session's space
client.set_space(space_name)
auth_resp = client.authenticate('user', 'password')
if auth_resp.error_code:
raise AuthException("Auth failed")
do_simple_execute(client, 'USE %s' % space_name)
time.sleep(1)
#
data = pd.read_csv('wiki-topcats.csv', sep=' ', header=None, converters={0: int, 1: int})
# vertex
# vertex_ids = list(set(data[0]) | set(data[1]))
step = 200
start = time.time()
#import vertex:
# for index in range(0,len(vertex_ids),step):
# string0 = ""
# for node in vertex_ids[index:index+step]:
# string0+='INSERT VERTEX vid_type(vid) VALUES ' + str(node)+':('+str(node)+');'
# do_simple_execute(client,string0)
batch_number = 0
mid=time.time()
print('Vertex time', mid-start)
# #import edge:
for index in range(0,data.shape[0],step):
string00 = "INSERT EDGE vid_edge(eid) VALUES "
tmp = data.iloc[index:(index+step),:]
tmp.reset_index(drop=True,inplace=True)
for i in range(tmp.shape[0]):
row = tmp.loc[i, :]
string00+=str(row[0])+'->'+str(row[1])+':(1),'
do_simple_execute(client, string00[0:-1])
batch_number+=1
print(batch_number)