the RIStatsProvider interface requires that counter and stat values be
ChoiceOf(float, int, long) the recent changes to storage server to not
track 'consumed' led to returning None as the value of a counter.
this causes violations to be experienced by nodes whose stats are being
gathered.
this patch simply omits that stat if 'consumed' is not being tracked.
fileutil.rm_dir(self.incomingdir)
def get_stats(self):
- return { 'storage_server.consumed': self.consumed,
- 'storage_server.allocated': self.allocated_size(),
- }
+ stats = { 'storage_server.allocated': self.allocated_size(), }
+ if self.consumed is not None:
+ stats['storage_server.consumed'] = self.consumed
+ return stats
def allocated_size(self):
space = self.consumed or 0