コード例 #1
0
ファイル: cstorage-Bench.py プロジェクト: EzanLTD/canopsis
	update_speed = int(update_nb / timer.elapsed)

	## Remove all records
	timer.start()
	storage.remove(records)
	timer.stop()
	remove_nb = len(records)
	remove_speed = int(remove_nb / timer.elapsed)
	
	print " + Insert Speed:",insert_speed,"records/s (%s records)" % insert_nb
	print " + Read Speed:",read_speed,"records/s (%s records)" % read_nb
	print " + Update Speed:",update_speed,"records/s (%s records)" % update_nb
	print " + Remove Speed:",remove_speed,"records/s (%s records)" % remove_nb



namespace = "bench-"+str(random.randint(0,1000))
account = caccount()
storage = cstorage(account=account, namespace=namespace, logging_level=logging.INFO)
timer = ctimer(logging_level=logging.INFO)

print "Bench with 'anonymous' account ..."
account = caccount()
go(account, 5000)

print "Bench with 'root' account ..."
account = caccount(user="******", group="root")
go(account, 5000)

storage.drop_namespace(namespace)
コード例 #2
0
 def test_1_Init(self):
     global mytimer
     mytimer = ctimer(logging_level=logging.DEBUG)
コード例 #3
0
ファイル: ctimer-Myunittest.py プロジェクト: EzanLTD/canopsis
	def test_1_Init(self):
		global mytimer
		mytimer = ctimer(logging_level=logging.DEBUG)
コード例 #4
0
ファイル: cstorage-Bench.py プロジェクト: moas/canopsis
    ## Remove all records
    timer.start()
    storage.remove(records)
    timer.stop()
    remove_nb = len(records)
    remove_speed = int(remove_nb / timer.elapsed)

    print " + Insert Speed:", insert_speed, "records/s (%s records)" % insert_nb
    print " + Read Speed:", read_speed, "records/s (%s records)" % read_nb
    print " + Update Speed:", update_speed, "records/s (%s records)" % update_nb
    print " + Remove Speed:", remove_speed, "records/s (%s records)" % remove_nb


namespace = "bench-" + str(random.randint(0, 1000))
account = caccount()
storage = cstorage(account=account,
                   namespace=namespace,
                   logging_level=logging.INFO)
timer = ctimer(logging_level=logging.INFO)

print "Bench with 'anonymous' account ..."
account = caccount()
go(account, 5000)

print "Bench with 'root' account ..."
account = caccount(user="******", group="root")
go(account, 5000)

storage.drop_namespace(namespace)