]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
BucketCountingCrawler: store just the count, not cycle+count, since it's too easy...
authorBrian Warner <warner@lothar.com>
Sat, 21 Feb 2009 04:58:31 +0000 (21:58 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 21 Feb 2009 04:58:31 +0000 (21:58 -0700)
src/allmydata/storage/crawler.py
src/allmydata/storage/server.py
src/allmydata/web/storage.py

index d6c342fb20c8b0bc2ecfb3f94d945b89140185f9..89d4407daed6db59450696d35193aa7610df938b 100644 (file)
@@ -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:
index f0db0a5438e12538af530fd54a5bec3a88484681..1604b10e4c2ecffb456fc06321b0296ce3edbdf6 100644 (file)
@@ -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
 
 
index f3dd37c60a5fdfdd8ca8caed1f2d1bccee3d8ea1..6cff994add846a0b809f3e6fe00e55f696cce7e7 100644 (file)
@@ -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):