def push(time_sec, record)
      message = extract_message(record)
      if message.nil?
        @exception_detector.reset
        detection_status = :no_trace
      else
        force_flush if @max_bytes > 0 &&
                       @buffer_size + message.length > @max_bytes
        detection_status = @exception_detector.update(message)
      end

      update_buffer(detection_status, time_sec, record, message)

      force_flush if @max_lines > 0 && @messages.length == @max_lines
    end
def push(time_sec, record)
      message = extract_message(record)
      if message.nil?
        @exception_detector.reset
        detection_status = :no_trace
      else
        force_flush if @max_bytes > 0 &&
                       @buffer_size + message.length > @max_bytes
        detection_status = @exception_detector.update(message)
      end

      update_buffer(detection_status, time_sec, record, message)

      force_flush if @max_lines > 0 && @messages.length == @max_lines
    end
If message_field is nil, the instance is set up to accumulate
 records that are plain strings (i.e. the whole record is concatenated).
 Otherwise, the instance accepts records that are dictionaries (usually
 originating from structured JSON logs) and accumulates just the
 content of the given message field.
 message_field may contain the empty string. In this case, the
 TraceAccumulator 'learns' the field name from the first record by checking
 for some pre-defined common field names of text logs.
 The named parameters max_lines and max_bytes limit the maximum amount
 of data to be buffered. The default value 0 indicates 'no limit'.