def add_thread(self, thread_id, thread_name):
        """Registers the specified thread for this AddEvents request.

        Any thread id mentioned in any event in this request should first be registered here.

        @param thread_id: An id for the thread.  This can then be used as the value for a ``thread`` field
            in the ``event`` object passed to ``add_event``.  Should be unique for this session.
        @param thread_name: A human-readable name for the thread

        @type thread_id: str
        @type thread_name: str

        @return: True if there was the allowed bytes to send were not exceeded by adding this thread to the
            request.
        @rtype: bool
        """
        # Have to account for the extra space this will use when serialized.  See how much space we can allow for
        # the post fix right now.
        available_size_for_post_fix = self.__max_size - self.__buffer.tell()
        return self.__post_fix_buffer.add_thread_entry(thread_id, thread_name,
                                                       fail_if_buffer_exceeds=available_size_for_post_fix)
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/scalyr_client.py/AddEventsRequest.add_thread/original