MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / runit_query_runs

Function runit_query_runs

test/perf/orm2010.py:101–120  ·  view source on GitHub ↗
(status, factor=1, query_runs=5)

Source from the content-addressed store, hash-verified

99
100
101def runit_query_runs(status, factor=1, query_runs=5):
102 # do some heavier reading
103 for i in range(query_runs):
104 status("Heavy query run #%d" % (i + 1))
105
106 report = []
107
108 # load all the Grunts, print a report with their name, stats,
109 # and their bosses' stats.
110 for grunt in sess.query(Grunt):
111 report.append(
112 (
113 grunt.name,
114 grunt.savings,
115 grunt.employer.name,
116 grunt.employer.golf_average,
117 )
118 )
119
120 sess.close() # close out the session
121
122
123def run_with_profile(runsnake=False, dump=False):

Callers 1

run_with_timeFunction · 0.85

Calls 4

statusFunction · 0.85
queryMethod · 0.45
appendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected