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:
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
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):