code: def add_data(self, metric, value, ts=None):
          
          if not ts:
              ts = time.time()
          if self.__data_lock.acquire():
              self.__data.append((metric, (ts, value)))
              self.__data_lock.release()
              return True
          return False
docs: Add data to queue
  
          :param metric: the metric name
          :type metric: str
          :param value: the value of data
          :type value: int
          :param ts: the timestamp
          :type ts: int | None
          :return: True if added successfully, otherwise False
          :rtype: bool