Пример #1
0
 def estimate_rho(self, rho_star):
     """Estimate new value of rho based on past network performance."""
     #log.debug("[cs-buflo] rho stats: %s" % self._rho_stats)
     time_intervals = gu.flatten_list([gu.apply_consecutive_elements(burst_list, lambda x, y: (y - x) * const.SCALE)
                                       for burst_list in self._rho_stats])
     #log.debug("[cs-buflo] Time intervals = %s", time_intervals)
     if len(time_intervals) == 0:
         return rho_star
     else:
         return math.pow(2, math.floor(math.log(mu.median(time_intervals), 2)))
Пример #2
0
 def getAverageTs(self):
     avg_ts = mu.median(gu.get_iats([t[0] for t in gu.flatten_list(self.iat_length_tuples)]))
     log.debug("[bwdiff - %s] Average ts in the session is: %s.",
               self.end, avg_ts)
     return avg_ts