91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Neo4j+py2neo性能測試(CMDB二)

發布時間:2020-07-08 23:21:35 來源:網絡 閱讀:4742 作者:Leon之 欄目:軟件技術
性能測試:
本地筆記本,CPU: i5, 內存: 8G, win7_x64, python 2.7, neo4j comunity 2.0.

創建60000個CI, 耗時1分51秒, 平均1秒創建540個CI, 每個CI包含屬性3-7個屬性

In [11]: py2neo_initialzation.create_ci(10000)

10000X6CIs

Tue Dec 24 17:04:43 2013

Tue Dec 24 17:06:34 2013

創建50000個關聯關系,耗時4分27秒,平均1秒創建187個relationship.

In [12]: py2neo_initialzation.create_relationship(10000)

Tue Dec 24 17:07:23 2013

Tue Dec 24 17:11:50 2013


測試代碼:

from py2neo import node,rel
from py2neo import neo4j
import time
import datetime
g=neo4j.GraphDatabaseService('http://localhost:7474/db/data')
import cmdb.py2neo_function as neofunction
# data initialize
#storage
def 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(g,'ci_class','storage')
    print datetime.datetime.now()
      
    #get all small_server nodes
    small_server_list=neofunction.SearchNodes(g,'ci_class','small_server')
      
    g.create((small_server_list[0],'depend_on',storage_list[0]))
      
    #get all lpar nodes
    lpar_list=neofunction.SearchNodes(g,'ci_class','small_server')
      
    #get all was nodes
    was_list=neofunction.SearchNodes(g,'ci_class','was_node')
      
    #get all db_instance nodes
    dbi_list=neofunction.SearchNodes(g,'ci_class','db_instance')
      
    #get all app nodes
    app_list=neofunction.SearchNodes(g,'ci_class','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()


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

呼和浩特市| 南京市| 湟中县| 长岛县| 邮箱| 桐城市| 建德市| 涪陵区| 贵定县| 周至县| 吴川市| 莱阳市| 白山市| 九龙城区| 四会市| 化德县| 兴义市| 芜湖市| 莎车县| 广水市| 临猗县| 双柏县| 郸城县| 安新县| 宜黄县| 涿鹿县| 开鲁县| 射阳县| 余庆县| 林芝县| 阿坝| 庆安县| 南城县| 南阳市| 小金县| 平安县| 库尔勒市| 乌拉特后旗| 宿松县| 东至县| 忻州市|