In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Performance test: local notebook, CPU: i5, memory: 8G, win7_x64, python 2.7, neo4j comunity 2.0.
It takes 1 minute and 51 seconds to create 60000 CI, with an average of 540 CI per second. Each CI contains 3-7 attributes.
In [11]: py2neo_initialzation.create_ci (10000)
10000X6CIs
Tue Dec 24 17:04:43 2013
Tue Dec 24 17:06:34 2013
It took 4 minutes and 27 seconds to create 50000 associations, with an average of 1 second creating 50000 relationship.
In [12]: py2neo_initialzation.create_relationship (10000)
Tue Dec 24 17:07:23 2013
Tue Dec 24 17:11:50 2013
Test the code:
From py2neo import node Relfrom py2neo import neo4jimport timeimport datetimeg=neo4j.GraphDatabaseService ('http://localhost:7474/db/data')import cmdb.py2neo_function as neofunction# data initialize#storagedef create_ci (total_ci): print'% dX6CIs'% total_ci print time.ctime () for i in range (total_ci): storage_name='storage_%d'% I small_server_name='aix_%d'% I lpar_name='lpar _% d'% I db_name='db_%d'% I was_name='was_%d'% I app_name='app_%d'% I g.create (node (ci_class='storage') City='Shanghai',district='PuDong',name=storage_name,rack=1,capacity=300), node (ci_class='small_server',city='Shanghai',district='PuDong',name=small_server_name,cpu_count=16,mem_GB=64), node (ci_class='lpar',city='Shanghai',district='PuDong',name=lpar_name,cpu_count=1,mem_GB=2), node (ci_class='db_instance',name=db_name,type='db2') Version='9.1'), node (ci_class='was_node',name=was_name,version='6.1'), node (ci_class='application',name=app_name)) print time.ctime () def create_relationship (total_ci): # get the nodes # get all storeage nodes print 'get all storage nodes Count number about% d'% total_ci print datetime.datetime.now () storage_list=neofunction.SearchNodes print datetime.datetime.now () # get all small_server nodes small_server_list=neofunction.SearchNodes ((small_server_list [0], 'depend_on') Storage_ list [0]) # get all lpar nodes lpar_list=neofunction.SearchNodes # get all was nodes was_list=neofunction.SearchNodes (gGramingly cipher classclassrecy wasteful node') # get all db_instance nodes dbi_list=neofunction.SearchNodes (gparamentcience classrooms classrooms dactyinstance') # get all app nodes app_list=neofunction.SearchNodes (gheroine baby classbooks 'application') print time.ctime () for i in range (total_ci): g.create ((lpar_ list [I],' depend_on',small_server_ list [I]) g.create ((dbi_ list [I], 'running_on',lpar_ list [I])) g.create ((was_list [I],' running_on') Lpar_ list [I]) g.create ((app_ list [I], 'depend_on',dbi_ list [I]) g.create ((app_ list [I],' depend_on',was_ list [I])) print time.ctime ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.