code: def addValue(self, value):
      
      self['count'] += 1
      self.__sample.update(value)
      if time.time() > self.__timestamp + 20 and len(self.__sample) > 1:
        self.__timestamp = time.time()
        self['min'] = self.__sample.min
        self['max'] = self.__sample.max
        self['mean'] = self.__sample.mean
        self['stddev'] = self.__sample.stddev
  
        percentiles = self.__sample.percentiles([0.5, 0.75, 0.95, 0.98, 0.99, 0.999])
        self['median'] = percentiles[0]
        self['75percentile'] = percentiles[1]
        self['95percentile'] = percentiles[2]
        self['98percentile'] = percentiles[3]
        self['99percentile'] = percentiles[4]
        self.percentile99 = percentiles[4]
        self['999percentile'] = percentiles[5]
docs: Updates the dictionary.