devtools/stresstester.py
changeset 2476 1294a6bdf3bf
parent 1977 606923dff11b
child 3647 2941f4a0aab9
child 4212 ab6573088b4a
equal deleted inserted replaced
2475:b6753521129d 2476:1294a6bdf3bf
     1 """ Usage: %s [OPTIONS] <application id> <queries file>
     1 """ Usage: %s [OPTIONS] <instance id> <queries file>
     2 
     2 
     3 Stress test a CubicWeb repository
     3 Stress test a CubicWeb repository
     4 
     4 
     5 OPTIONS:
     5 OPTIONS:
     6   -h / --help
     6   -h / --help
   149     queries =  [query for query in lines(args[1]) if not query.startswith('#')]
   149     queries =  [query for query in lines(args[1]) if not query.startswith('#')]
   150     if user is None:
   150     if user is None:
   151         user = raw_input('login: ')
   151         user = raw_input('login: ')
   152     if password is None:
   152     if password is None:
   153         password = getpass('password: ')
   153         password = getpass('password: ')
   154     from cubicweb.cwconfig import application_configuration
   154     from cubicweb.cwconfig import instance_configuration
   155     config = application_configuration(args[0])
   155     config = instance_configuration(args[0])
   156     # get local access to the repository
   156     # get local access to the repository
   157     print "Creating repo", prof_file
   157     print "Creating repo", prof_file
   158     repo = Repository(config, prof_file)
   158     repo = Repository(config, prof_file)
   159     cnxid = repo.connect(user, password)
   159     cnxid = repo.connect(user, password)
   160     # connection to the CubicWeb repository
   160     # connection to the CubicWeb repository