percent used was not available within the osd metric tree only the
physical disk. With the inclusion under the osd, the percent_used can
reference the osd_id directly easier in any queries
import os
import time
+import math
from collectors.base import BaseCollector
from collectors.common import (todict, fread, freadlines, merge_dicts,
self._current = {}
self._previous = {}
self._osd_type = osd_type
-
+ self.osd_percent_used = 0
def update(self, stats):
"""
for attr in stats['osd']:
setattr(self, attr, stats['osd'].get(attr))
+ self.osd_percent_used = math.ceil((float(self.stat_bytes_used) /
+ self.stat_bytes) * 100)
class OSDs(BaseCollector):