From: Brian Warner Date: Sat, 21 Feb 2009 04:58:31 +0000 (-0700) Subject: BucketCountingCrawler: store just the count, not cycle+count, since it's too easy... X-Git-Tag: allmydata-tahoe-1.4.0~160 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/module-simplejson.scanner.html?a=commitdiff_plain;h=106d31b1122689f1f58ed83eb5e06b4949feb835;p=tahoe-lafs%2Ftahoe-lafs.git BucketCountingCrawler: store just the count, not cycle+count, since it's too easy to make usage mistakes otherwise --- diff --git a/src/allmydata/storage/crawler.py b/src/allmydata/storage/crawler.py index d6c342fb..89d4407d 100644 --- a/src/allmydata/storage/crawler.py +++ b/src/allmydata/storage/crawler.py @@ -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: diff --git a/src/allmydata/storage/server.py b/src/allmydata/storage/server.py index f0db0a54..1604b10e 100644 --- a/src/allmydata/storage/server.py +++ b/src/allmydata/storage/server.py @@ -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 diff --git a/src/allmydata/web/storage.py b/src/allmydata/web/storage.py index f3dd37c6..6cff994a 100644 --- a/src/allmydata/web/storage.py +++ b/src/allmydata/web/storage.py @@ -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):