-#! /usr/bin/python
-
"""
this is a load-generating client program. It does all of its work through a
given tahoe node (specified by URL), and performs random reads and writes
if name not in stats:
stats[name] = 0
stats[name] += float(value)
+ del name
if last_stats:
- delta = dict( [ (name,stats[name]-last_stats[name])
- for name in stats ] )
+ delta = dict( [ (n,stats[n]-last_stats[n])
+ for n in stats ] )
print "THIS SAMPLE:"
for name in sorted(delta.keys()):
avg = float(delta[name]) / float(DELAY)
directories_read = 0
directories_written = 0
-def listdir(nodeurl, root, vdrive_pathname):
+def listdir(nodeurl, root, remote_pathname):
if nodeurl[-1] != "/":
nodeurl += "/"
url = nodeurl + "uri/%s/" % urllib.quote(root)
- if vdrive_pathname:
- url += urllib.quote(vdrive_pathname)
+ if remote_pathname:
+ url += urllib.quote(remote_pathname)
url += "?t=json"
data = urllib.urlopen(url).read()
try:
path = "/"
return scheme, host, port, path
-def generate_and_put(nodeurl, root, vdrive_fname, size):
+def generate_and_put(nodeurl, root, remote_filename, size):
if nodeurl[-1] != "/":
nodeurl += "/"
url = nodeurl + "uri/%s/" % urllib.quote(root)
- url += urllib.quote(vdrive_fname)
+ url += urllib.quote(remote_filename)
scheme, host, port, path = parse_url(url)
if scheme == "http":