disk_total = s.f_bsize * s.f_blocks
disk_used = s.f_bsize * (s.f_blocks - s.f_bfree)
# spacetime predictors should look at the slope of disk_used.
- disk_avail = s.f_bsize * s.f_bavail # available to non-root users
+ disk_free_for_root = s.f_bsize * s.f_bfree
+ disk_free_for_nonroot = s.f_bsize * s.f_bavail
+
# include our local policy here: if we stop accepting shares when
# the available space drops below 1GB, then include that fact in
# disk_avail.
- disk_avail -= self.reserved_space
+ disk_avail = disk_free_for_nonroot - self.reserved_space
disk_avail = max(disk_avail, 0)
if self.readonly_storage:
disk_avail = 0
# spacetime predictors should use disk_avail / (d(disk_used)/dt)
stats["storage_server.disk_total"] = disk_total
stats["storage_server.disk_used"] = disk_used
+ stats["storage_server.disk_free_for_root"] = disk_free_for_root
+ stats["storage_server.disk_free_for_nonroot"] = disk_free_for_nonroot
stats["storage_server.disk_avail"] = disk_avail
except AttributeError:
# os.statvfs is available only on unix
for k,v in self.storage.get_stats().items() ])
d.setdefault("disk_total", None)
d.setdefault("disk_used", None)
+ d.setdefault("disk_free_for_root", None)
+ d.setdefault("disk_free_for_nonroot", None)
d.setdefault("reserved_space", None)
d.setdefault("disk_avail", None)
return d
<td><span n:render="space" n:data="disk_total" /></td></tr>
<tr><td>Disk space used:</td>
<td>- <span n:render="space" n:data="disk_used" /></td></tr>
+ <tr><td />
+ <td>======</td></tr>
+ <tr><td>Disk space free (root):</td>
+ <td><span n:render="space" n:data="disk_free_for_root"/>
+ [see 1]</td></tr>
+ <tr><td>Disk space free (non-root):</td>
+ <td><span n:render="space" n:data="disk_free_for_nonroot" />
+ [see 2]</td></tr>
<tr><td>Reserved space:</td>
<td>- <span n:render="space" n:data="reserved_space" /></td></tr>
<tr><td />
</li>
</ul>
+ <p>[1]: Some of this space may be reserved for the superuser.</p>
+ <p>[2]: This reports the space available to non-root users, including the
+ Tahoe node.</p>
+
</div>
</body>