Files
deb-python-cassandra-driver/cqlengine/tests/test_load.py
Jon Haddad 4bb8b313c0 made create_keyspace more sane, fixed broken tests.
create_keyspace no longer has defaults for SimpleStrategy and
replication factor.  changed tests to use the default keyspace,
cqlengine_test for all tests.  Not sure why other keyspaces were being
used.
2015-01-14 08:35:37 -08:00

35 lines
790 B
Python

import os
from unittest import TestCase, skipUnless
from cqlengine import Model, Integer
from cqlengine.management import sync_table
from cqlengine.tests import base
import resource
import gc
class LoadTest(Model):
k = Integer(primary_key=True)
v = Integer()
@skipUnless("LOADTEST" in os.environ, "LOADTEST not on")
def test_lots_of_queries():
sync_table(LoadTest)
import objgraph
gc.collect()
objgraph.show_most_common_types()
print("Starting...")
for i in range(1000000):
if i % 25000 == 0:
# print memory statistic
print("Memory usage: %s" % (resource.getrusage(resource.RUSAGE_SELF).ru_maxrss))
LoadTest.create(k=i, v=i)
objgraph.show_most_common_types()
raise Exception("you shouldn't be here")