def add_thread_entry(self, thread_id, thread_name, fail_if_buffer_exceeds=None):
        """Adds in a new thread entry that will be included in the post fix.


        @param thread_id: The id of the thread.
        @param thread_name: The name of the thread.
        @param fail_if_buffer_exceeds: The maximum number of bytes that can be used by the post fix when serialized.
            If this is not None, and the size will exceed this amount when the thread entry is added, then the
            thread is not added and False is returned.

        @type thread_id: str
        @type thread_name: str
        @type fail_if_buffer_exceeds: None|int

        @return: True if the thread was added (can only return False if fail_if_buffer_exceeds is not None)
        @rtype: bool
        """
        # Calculate the size difference.  It is at least the size of taken by the serialized strings.
        size_difference = len(json_lib.serialize(thread_name)) + len(json_lib.serialize(thread_id))

        # Use the __per_thread_extra_bytes to calculate the additional bytes that will be consumed by serializing
        # the JSON object containing the thread id and name.  The number of extra bytes depends on whether or not
        # there is already an entry in the JSON array, so take that into consideration.
        num_threads = len(self.__threads)
        if num_threads < 1:
            size_difference += PostFixBuffer.__per_thread_extra_bytes[0]
        else:
            size_difference += PostFixBuffer.__per_thread_extra_bytes[1]

        if fail_if_buffer_exceeds is not None and fail_if_buffer_exceeds > self.__current_size + size_difference:
            return False

        self.__current_size += size_difference
        self.__threads.append({'id': thread_id, 'name': thread_name})
        return True
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/scalyr_client.py/PostFixBuffer.add_thread_entry/swapped operands of `>`