def compute(self, period=YEAR, mult=1): """ probability of survival for an arbitrary object period -- time period over which to estimate failures mult -- FIT rate multiplier """ self.P_site = float(1) - Pfail(self.fits * mult, period, n=0) self.L_site = self.size self.dur = 1.0 - self.P_site
def compute(self, period=YEAR, mult=1, secondary=False): """ compute probabilities and expected data loss for likely failures period -- time over which we want to model failures mult -- FIT rate multiplier (e.g. many parallel units) secondary -- this is a second (more likely) failure """ fits = self.fits2 if secondary else self.fits self.P_drive = float(1) - Pfail(fits * mult, period, n=0) self.L_drive = self.size self.P_nre = self.p_nre(bytes=self.size * mult) self.L_nre = self.size self.dur = 1.0 - (self.P_drive + self.P_nre)
def availability(self): """ fraction of the time during which a remote copy is available """ # if we are ignoring failures, availability is 100% if self.fits == 0: return 1.0 # if there is no repair, annual probability of non-failure if self.replace == 0: return Pfail(self.fits, YEAR, n=0) # one minus the time between failures and repair ttf = mttf(self.fits) return float(ttf) / (ttf + self.replace)