~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: John Arbash Meinel
  • Date: 2011-02-09 21:17:32 UTC
  • mto: This revision was merged to the branch mainline in revision 426.
  • Revision ID: john@arbash-meinel.com-20110209211732-ysrgacmnoygm891e
Start working on some code to do load testing of loggerhead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009, 2010 Canonical Ltd
 
1
# Copyright 2009, 2010, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
38
38
if __name__ == 'bzrlib.plugins.loggerhead':
39
39
    import bzrlib
40
40
    from bzrlib.api import require_any_api
 
41
    from bzrlib import commands
41
42
 
42
43
    require_any_api(bzrlib, bzr_compatible_versions)
43
44
 
107
108
        transport_server_registry.register('http', serve_http, help=HELP)
108
109
    else:
109
110
        import bzrlib.builtins
110
 
        from bzrlib.commands import get_cmd_object, register_command
111
111
        from bzrlib.option import Option
112
112
 
113
 
        _original_command = get_cmd_object('serve')
 
113
        _original_command = commands.get_cmd_object('serve')
114
114
 
115
115
        class cmd_serve(bzrlib.builtins.cmd_serve):
116
116
            __doc__ = _original_command.__doc__
137
137
                else:
138
138
                    super(cmd_serve, self).run(*args, **kw)
139
139
 
140
 
        register_command(cmd_serve)
 
140
        commands.register_command(cmd_serve)
 
141
 
 
142
    class cmd_load_test_loggerhead(commands.Command):
 
143
        """Run a load test against a live loggerhead instance.
 
144
        """
 
145
 
 
146
        def run(self):
 
147
            from bzrlib.plugins.loggerhead.loggerhead import load_test
 
148
            load_test.run()
141
149
 
142
150
    def load_tests(standard_tests, module, loader):
143
151
        _ensure_loggerhead_path()