Module Assign NameStore Str If CompareEq NameLoad Str body ImportFrom alias ImportFrom alias Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Assign NameStore IfExp CompareEq NameLoad Str NameLoad NameLoad Assign NameStore Call AttributeLoad Str attr Call NameLoad Assign NameStore ListLoad Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Dict Str NameLoad FunctionDef arguments args defaults body Return Dict Str Str Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListComp Call NameLoad comprehension NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call NameLoad Str Return NameLoad orelse Expr Call NameLoad Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad Str TryExcept body Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list If NameLoad body With Call NameLoad Str body TryExcept body Assign NameStore Call AttributeLoad NameLoad attr keyword Str keyword Str keyword Str keyword Str handlers ExceptHandler body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad Str Expr Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad Num Expr Call NameLoad NameLoad Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr
N/A N/A __author__ Chris Tabor (dxdstudio@gmail.com) N/A N/A __name__ __main__ N/A os getcwd os sys N/A N/A N/A N/A sys path append N/A getcwd MOAL.helpers.display Section MOAL.helpers.display print_success MOAL.helpers.display print_info MOAL.helpers.display print_warning MOAL.helpers.display print_h2 MOAL.helpers.trials test_speed uuid uuid1 faker Factory N/A psycopg2 N/A pylibmc N/A DEBUG N/A N/A __name__ __main__ True False N/A CACHE_KEY N/A N/A people_key_{} format N/A uuid1 N/A CLIENTS N/A 127.0.0.1 N/A faker N/A N/A Factory create N/A mclient N/A N/A pylibmc Client CLIENTS binary True behaviors N/A tcp_nodelay True make_person N/A N/A N/A N/A N/A N/A name email address N/A N/A faker name N/A N/A faker email N/A N/A faker address N/A create_records N/A N/A max_records N/A N/A N/A peeps N/A N/A make_person N/A n N/A range max_records N/A N/A N/A cur executemany INSERT INTO cache_table(name, email, address)
            VALUES (%(name)s, %(email)s, %(address)s) peeps N/A N/A N/A conn commit N/A get_records N/A N/A cur N/A N/A N/A cached N/A N/A mclient get CACHE_KEY N/A cached N/A N/A N/A print_success Found the cached version instead N/A cached N/A N/A N/A print_warning Looking up SQL Records N/A N/A N/A cur execute SELECT * FROM cache_table; N/A records N/A N/A cur fetchall N/A N/A N/A conn commit N/A N/A N/A mclient set CACHE_KEY records N/A records N/A test_speed cleanup N/A N/A cur conn N/A N/A N/A N/A print_info Cleaning up... N/A N/A N/A N/A N/A cur execute DROP TABLE cache_table; N/A N/A N/A N/A psycopg2 ProgrammingError N/A N/A N/A N/A conn commit N/A N/A N/A mclient delete CACHE_KEY N/A N/A DEBUG N/A N/A N/A Section Memcached N/A N/A N/A N/A conn N/A N/A psycopg2 connect dbname ctabor user ctabor host localhost password N/A N/A N/A N/A N/A Exception Could not connect to PostgreSql N/A cur N/A N/A conn cursor N/A N/A print_h2 Adding a bunch of records... N/A N/A cleanup cur conn N/A N/A N/A cur execute CREATE TABLE cache_table(id serial PRIMARY KEY,
            name varchar, email varchar, address varchar) N/A N/A create_records 5000 N/A N/A get_records cur N/A N/A get_records cur N/A N/A N/A cur close