stats gathering: fix storage server stats if not tracking consumed
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.
This commit is contained in:
parent
ef0f523fe0
commit
35319c3380
|
@ -728,9 +728,10 @@ class StorageServer(service.MultiService, Referenceable):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue