repo.or.cz
/
bwmon.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Test cases; profiling and simulation
[bwmon.git]
/
test
/
generate_random_urls.py
blob
0a71371ee6da2cba17cd9a6f50fd94a2eb205bfe
1
2
import
sys
3
import
urllib2
4
import
socket
5
6
socket
.
setdefaulttimeout
(
1
)
7
8
RANDOM_URL
=
'http://random.yahoo.com/bin/ryl'
9
COUNT
=
200
10
11
urls
= []
12
while
len
(
urls
) <
COUNT
:
13
try
:
14
fp
=
urllib2
.
urlopen
(
RANDOM_URL
)
15
print
fp
.
url
16
urls
.
append
(
fp
.
url
)
17
fp
.
close
()
18
sys
.
stdout
.
flush
()
19
except
Exception
,
e
:
20
print
>>
sys
.
stderr
,
e
21
continue
22