5 if len(sys.argv) > 1 and sys.argv[1] == "config":
7 graph_title Tahoe File Estimate
10 graph_info This graph shows the estimated number of files and directories present in the grid
15 # Edit this to point at some subset of storage directories.
16 node_dirs = [os.path.expanduser("~amduser/prodnet/storage1"),
17 os.path.expanduser("~amduser/prodnet/storage2"),
18 os.path.expanduser("~amduser/prodnet/storage3"),
19 os.path.expanduser("~amduser/prodnet/storage4"),
22 sections = ["aa", "ab", "ac", "ad", "ae", "af", "ag", "ah", "ai", "aj"]
23 # and edit this to reflect your default encoding's "total_shares" value, and
24 # the total number of servers.
29 for base in node_dirs:
30 for section in sections:
31 sampledir = os.path.join(base, "storage", "shares", section)
32 indices = os.listdir(sampledir)
33 index_strings.update(indices)
34 unique_strings = len(index_strings)
36 # the chance that any given file appears on any given server
37 chance = 1.0 * N / num_servers
39 # the chance that the file does *not* appear on the servers that we're
41 no_chance = (1-chance) ** len(node_dirs)
43 # if a file has a 25% chance of not appearing in our sample, then we need to
44 # raise our estimate by (1.25/1)
45 correction = 1+no_chance
46 #print "correction", correction
48 files = unique_strings * (32*32/len(sections)) * correction
49 print "files.value %d" % int(files)