Module: Appsignal::Extension::Jruby Private

Extended by:
FFI::Library
Includes:
StringHelpers
Included in:
Appsignal::Extension
Defined in:
lib/appsignal/extension/jruby.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

JRuby extension wrapper

Only loaded if the system is detected as JRuby.

Defined Under Namespace

Modules: StringHelpers Classes: Data, Span, Transaction

Class Method Summary collapse

Instance Method Summary collapse

Methods included from StringHelpers

#make_appsignal_string, #make_ruby_string

Class Method Details

.lib_extensionObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



42
43
44
45
46
47
48
# File 'lib/appsignal/extension/jruby.rb', line 42

def self.lib_extension
  if Appsignal::System.agent_platform.include?("darwin")
    "dylib"
  else
    "so"
  end
end

Instance Method Details

#add_distribution_value(key, value, tags) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



324
325
326
# File 'lib/appsignal/extension/jruby.rb', line 324

def add_distribution_value(key, value, tags)
  appsignal_add_distribution_value(make_appsignal_string(key), value, tags.pointer)
end

#data_array_newObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



301
302
303
# File 'lib/appsignal/extension/jruby.rb', line 301

def data_array_new
  Data.new(appsignal_data_array_new)
end

#data_map_newObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



297
298
299
# File 'lib/appsignal/extension/jruby.rb', line 297

def data_map_new
  Data.new(appsignal_data_map_new)
end

#diagnoseObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



267
268
269
# File 'lib/appsignal/extension/jruby.rb', line 267

def diagnose
  make_ruby_string(appsignal_diagnose)
end

#get_server_state(key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



271
272
273
274
# File 'lib/appsignal/extension/jruby.rb', line 271

def get_server_state(key)
  state = appsignal_get_server_state(make_appsignal_string(key))
  make_ruby_string state if state[:len] > 0
end

#increment_counter(key, value, tags) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



320
321
322
# File 'lib/appsignal/extension/jruby.rb', line 320

def increment_counter(key, value, tags)
  appsignal_increment_counter(make_appsignal_string(key), value, tags.pointer)
end

#log(group, level, message, attributes) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



276
277
278
279
280
281
282
283
# File 'lib/appsignal/extension/jruby.rb', line 276

def log(group, level, message, attributes)
  appsignal_log(
    make_appsignal_string(group),
    level,
    make_appsignal_string(message),
    attributes.pointer
  )
end

#running_in_container?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


305
306
307
# File 'lib/appsignal/extension/jruby.rb', line 305

def running_in_container?
  appsignal_running_in_container
end

#set_environment_metadata(key, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



309
310
311
312
313
314
# File 'lib/appsignal/extension/jruby.rb', line 309

def (key, value)
  (
    make_appsignal_string(key),
    make_appsignal_string(value)
  )
end

#set_gauge(key, value, tags) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



316
317
318
# File 'lib/appsignal/extension/jruby.rb', line 316

def set_gauge(key, value, tags)
  appsignal_set_gauge(make_appsignal_string(key), value, tags.pointer)
end

#startObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



259
260
261
# File 'lib/appsignal/extension/jruby.rb', line 259

def start
  appsignal_start
end

#start_transaction(transaction_id, namespace, gc_duration_ms) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



285
286
287
288
289
290
291
292
293
294
295
# File 'lib/appsignal/extension/jruby.rb', line 285

def start_transaction(transaction_id, namespace, gc_duration_ms)
  transaction = appsignal_start_transaction(
    make_appsignal_string(transaction_id),
    make_appsignal_string(namespace),
    gc_duration_ms
  )

  return if !transaction || transaction.null?

  Transaction.new(transaction)
end

#stopObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



263
264
265
# File 'lib/appsignal/extension/jruby.rb', line 263

def stop
  appsignal_stop
end