~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to serve-branches

  • Committer: Martin Albisetti
  • Date: 2008-11-14 21:45:00 UTC
  • mfrom: (232.1.8 dev-tools)
  • Revision ID: martin.albisetti@canonical.com-20081114214500-0fm3t669c8l7ykzr
Added --profile switch to profile Loggerhead. (Paul Hummer, Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                      help="Host Loggerhead should listen on.")
51
51
    parser.add_option("--prefix", dest="user_prefix",
52
52
                      help="Specify host prefix.")
 
53
    parser.add_option("--profile", action="store_true", dest="profile",
 
54
                      help="Generate callgrind profile data to "
 
55
                        "%d-stats.callgrind on each request.")
53
56
    parser.add_option("--reload", action="store_true", dest="reload",
54
57
                      help="Restarts the application when changing python"
55
58
                           " files. Only used for development purposes.")
116
119
    app = ErrorHandlerApp(app)
117
120
    app = HTTPExceptionHandler(app)
118
121
    app = TransLogger(app, logger=logger)
 
122
    if options.profile:
 
123
        from loggerhead.middleware.profile import LSProfMiddleware
 
124
        app = LSProfMiddleware(app)
119
125
 
120
126
    if not options.user_prefix:
121
127
        prefix = '/'