MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / main

Method main

examples/performance/__init__.py:324–396  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

322
323 @classmethod
324 def main(cls):
325 parser = argparse.ArgumentParser("python -m examples.performance")
326
327 if cls.name is None:
328 parser.add_argument(
329 "name", choices=cls._suite_names(), help="suite to run"
330 )
331
332 if len(sys.argv) > 1:
333 potential_name = sys.argv[1]
334 try:
335 __import__(__name__ + "." + potential_name)
336 except ImportError:
337 pass
338
339 parser.add_argument(
340 "--test", nargs="+", type=str, help="run specific test(s)"
341 )
342
343 parser.add_argument(
344 "--dburl",
345 type=str,
346 default="sqlite:///profile.db",
347 help="database URL, default sqlite:///profile.db",
348 )
349 parser.add_argument(
350 "--num",
351 type=int,
352 default=cls.num,
353 help="Number of iterations/items/etc for tests; "
354 "default is %d module-specific" % cls.num,
355 )
356 parser.add_argument(
357 "--profile",
358 action="store_true",
359 help="run profiling and dump call counts",
360 )
361 parser.add_argument(
362 "--sort",
363 type=str,
364 default="cumulative",
365 help="profiling sort, defaults to cumulative",
366 )
367 parser.add_argument(
368 "--dump",
369 action="store_true",
370 help="dump full call profile (implies --profile)",
371 )
372 parser.add_argument(
373 "--raw",
374 type=str,
375 help="dump raw profile data to file (implies --profile)",
376 )
377 parser.add_argument(
378 "--callers",
379 action="store_true",
380 help="print callers as well (implies --dump)",
381 )

Callers 7

__main__.pyFile · 0.45
single_inserts.pyFile · 0.45
bulk_inserts.pyFile · 0.45
short_selects.pyFile · 0.45
test_qualify.pyFile · 0.45
test_versioning.pyFile · 0.45

Calls 3

ProfilerClass · 0.85
_suite_namesMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected