Beispiel #1
0
def setup_tracking(project):
    heapmonitor.track_object(project)
    heapmonitor.track_class(Module)
    heapmonitor.track_class(Class)
    heapmonitor.track_class(Function)
    heapmonitor.track_class(Method)
    heapmonitor.track_class(CodeTree)
    heapmonitor.create_snapshot()

    # Finally call the real inspector.
    inspect_project_statically(project)
Beispiel #2
0
def setup_tracking(project):
    heapmonitor.track_object(project)
    heapmonitor.track_class(Module)
    heapmonitor.track_class(Class)
    heapmonitor.track_class(Function)
    heapmonitor.track_class(Method)
    heapmonitor.track_class(CodeTree)
    heapmonitor.create_snapshot()

    # Finally call the real inspector.
    inspect_project_statically(project)
Beispiel #3
0
def benchmark_project_memory_usage():
    # Take the argument to this script and inject it as an argument to
    # pythoscope's --init.
    application_path = sys.argv[1]
    sys.argv = ["pythoscope", "--init", application_path]

    # Inject a setup function before performing an inspection.
    pythoscope.inspect_project_statically = setup_tracking

    # Invoke pythoscope --init.
    pythoscope.main()

    # Show statistics.
    heapmonitor.create_snapshot()
    heapmonitor.print_stats(detailed=False)
Beispiel #4
0
def benchmark_project_memory_usage():
    # Take the argument to this script and inject it as an argument to
    # pythoscope's --init.
    application_path = sys.argv[1]
    sys.argv = ["pythoscope", "--init", application_path]

    # Inject a setup function before performing an inspection.
    pythoscope.inspect_project_statically = setup_tracking

    # Invoke pythoscope --init.
    pythoscope.main()

    # Show statistics.
    heapmonitor.create_snapshot()
    heapmonitor.print_stats(detailed=False)