You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: jruby.rb
    path of file: ./repos/appsignal-ruby/lib/appsignal/extension
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "ffi"

module Appsignal
  class Extension
    # JRuby extension wrapper
    #
    # O
    
        def record_event(name, title, body, body_format, duration, gc_duration_ms) # rubocop:disable Metrics/ParameterLists
          case body
          when String
            method = :appsignal_record_event
            body_arg = make_appsignal_string(body)
          when Data
            method = :appsignal_record_event_data
            body_arg = body.pointer
          else
            raise ArgumentError,
              "body argument should be a String or Appsignal::Extension::Data"
          end