mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-09 03:44:23 +00:00
BucketCountingCrawler: store just the count, not cycle+count, since it's too easy to make usage mistakes otherwise
This commit is contained in:
parent
3c6471c717
commit
106d31b112
@ -373,7 +373,7 @@ class BucketCountingCrawler(ShareCrawler):
|
||||
if len(last_counts) == len(self.prefixes):
|
||||
# great, we have a whole cycle.
|
||||
num_buckets = sum(last_counts.values())
|
||||
self.state["last-complete-bucket-count"] = (cycle, num_buckets)
|
||||
self.state["last-complete-bucket-count"] = num_buckets
|
||||
# get rid of old counts
|
||||
for old_cycle in list(self.state["bucket-counts"].keys()):
|
||||
if old_cycle != cycle:
|
||||
|
@ -173,8 +173,7 @@ class StorageServer(service.MultiService, Referenceable):
|
||||
s = self.bucket_counter.get_state()
|
||||
bucket_count = s.get("last-complete-bucket-count")
|
||||
if bucket_count:
|
||||
cycle, count = bucket_count
|
||||
stats["storage_server.total_bucket_count"] = count
|
||||
stats["storage_server.total_bucket_count"] = bucket_count
|
||||
return stats
|
||||
|
||||
|
||||
|
@ -65,10 +65,9 @@ class StorageStatus(rend.Page):
|
||||
|
||||
def data_last_complete_bucket_count(self, ctx, data):
|
||||
s = self.storage.bucket_counter.get_state()
|
||||
lcbc = s.get("last-complete-bucket-count")
|
||||
if lcbc is None:
|
||||
count = s.get("last-complete-bucket-count")
|
||||
if count is None:
|
||||
return "Not computed yet"
|
||||
cycle, count = lcbc
|
||||
return count
|
||||
|
||||
def render_count_crawler_status(self, ctx, storage):
|
||||
|
Loading…
x
Reference in New Issue
Block a user