The congress.tests.policy_engines.test_agnostic_performance Module

class congress.tests.policy_engines.test_agnostic_performance.TestDsePerformance(*args, **kwargs)

Bases: congress.tests.base.SqlTestCase

setUp()
tearDown()
test_initialize_tables_dse()

Test performance of initializing data with DSE and Engine.

This test populates the tables exported by a datasource driver, and then invokes the poll() method to send that data to the policy engine. It tests the amount of time to send tables across the DSE and load them into the policy engine.

test_initialize_tables_full()

Test performance of initializing data with Datasource, DSE, Engine.

This test gives a datasource driver the Python data that would have resulted from making an API call and parsing it into Python and then polls that datasource, waiting until the data arrives in the policy engine. It tests the amount of time required to translate Python data into tables, send those tables over the DSE, and load them into the policy engine.

wait_til_query_nonempty(*args, **kw)
class congress.tests.policy_engines.test_agnostic_performance.TestRuntimePerformance(*args, **kwargs)

Bases: congress.tests.base.TestCase

Tests for Runtime performance that are not specific to any theory.

To run one test:
nosetests -v congress/tests/policy_engines/test_agnostic_performance.py:TestRuntimePerformance.test_foo
To collect profiling data:
python -m cProfile -o profile.out which nosetests -v congress/tests/policy_engines/test_agnostic_performance.py:TestRuntimePerformance.test_foo
To parse and sort profiling data in different ways:
import pstats pstats.Stats(‘profile.out’).strip_dirs().sort_stats(“cum”).print_stats() pstats.Stats(‘profile.out’).strip_dirs().sort_stats(“time”).print_stats() pstats.Stats(‘profile.out’).strip_dirs().sort_stats(“calls”).print_stats()
setUp()
test_concurrency()
test_indexing()
test_insert_database()
test_insert_nonrecursive()
test_runtime_initialize_tables()
test_select_100matches()
test_select_1match()
test_simulate_latency()
test_simulate_throughput()
test_update_database()
test_update_nonrecursive()
test_update_rate()