Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ca432935
Commit
ca432935
authored
Aug 31, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cookie passing.
parent
24e4feca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
common/test/load/ab/abtest.py
+14
-7
common/test/load/pages_to_test
+2
-0
No files found.
common/test/load/ab/abtest.py
View file @
ca432935
...
...
@@ -96,12 +96,18 @@ def loadtest(args):
server
=
args
.
server
name
=
args
.
name
ab_options
=
args
.
abopt
if
args
.
abopt
else
[]
ab_options
+=
[
"-Aanant:agarwal"
]
ab_options
.
append
(
"-Aanant:agarwal"
)
cookies
=
[]
if
args
.
sessionid
:
ab_options
+=
[
"-C 'sessionid={0}'"
.
format
(
args
.
sessionid
)]
cookies
.
append
(
"sessionid={0}"
.
format
(
args
.
sessionid
))
if
args
.
csrftoken
:
ab_options
+=
[
"-C 'csrftoken={0}'"
.
format
(
args
.
csrftoken
)]
cookies
.
append
(
"csrftoken={0}"
.
format
(
args
.
csrftoken
))
if
len
(
cookies
)
>
0
:
cookie_str
=
"; "
.
join
(
cookies
)
ab_options
.
append
(
"-C '{0}'"
.
format
(
cookie_str
))
pages
=
args
.
pages
if
args
.
pages
else
[]
if
args
.
pagelist
:
...
...
@@ -114,8 +120,6 @@ def loadtest(args):
# want a string
ab_options
=
' '
.
join
(
str
(
s
)
for
s
in
ab_options
)
if
ab_options
is
not
None
else
""
reqs_per_thread
=
2
# If there are already results for this run, just delete them. (TODO: Desired behavior?)
os
.
system
(
"rm -rf {name}"
.
format
(
name
=
name
))
for
page
in
pages
:
...
...
@@ -123,8 +127,8 @@ def loadtest(args):
outdir
=
"{name}/page_{page}"
.
format
(
name
=
name
,
page
=
page
.
replace
(
'/'
,
'-'
))
print
"Testing {0}. Output in {1}"
.
format
(
url
,
outdir
)
os
.
makedirs
(
outdir
)
for
conc
in
[
1
]:
#[1, 2, 3, 10]
:
requests
=
conc
*
reqs_per_thread
for
conc
in
args
.
concurrency
:
requests
=
conc
*
args
.
reqs_per_thread
logpath
=
outdir
+
'/{requests}-{conc}.results'
.
format
(
requests
=
requests
,
conc
=
conc
)
test_url
(
url
,
requests
,
conc
,
ab_options
,
logpath
)
...
...
@@ -145,6 +149,9 @@ def main():
help
=
'if testing non-anonymously, specify session id'
)
parser
.
add_argument
(
'--csrftoken'
,
help
=
'if posting forms, specify csrftoken'
)
parser
.
add_argument
(
'-c'
,
dest
=
'concurrency'
,
action
=
'append'
,
type
=
int
,
default
=
[
1
],
help
=
"try this number of simultaneous threads. May be specified more than once."
)
parser
.
add_argument
(
'-r'
,
type
=
int
,
default
=
2
,
help
=
"Number of requests per thread"
,
dest
=
'reqs_per_thread'
)
parser
.
add_argument
(
'--name'
,
help
=
'test name--results will be in {name}/'
,
...
...
common/test/load/pages_to_test
View file @
ca432935
...
...
@@ -5,6 +5,7 @@
/courses/
/wiki/
/courses/BerkeleyX/CS188/fa12/wiki
/courses/BerkeleyX/CS188/fa12/wiki/6.002x/
/courses/BerkeleyX/CS188/fa12/discussion/forum
/courses/BerkeleyX/CS188/fa12/progress
/courses/BerkeleyX/CS188/fa12/info
...
...
@@ -12,3 +13,4 @@
# Berkeley-specific. Perhaps generate these automatically.
/courses/BerkeleyX/CS188/fa12/courseware/Week_1/Project_0_Tutorial/
/courses/BerkeleyX/CS188/fa12/wiki/6.002x/_create/?slug=DampedSecondOrderSystems
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment