Class: Appsignal::Extension::Jruby::Transaction Private
- Includes:
- StringHelpers
- Defined in:
- lib/appsignal/extension/jruby.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
rubocop:disable Metrics/ClassLength
Instance Attribute Summary collapse
- #pointer ⇒ Object readonly private
Instance Method Summary collapse
- #complete ⇒ Object private
- #finish(gc_duration_ms) ⇒ Object private
- #finish_event(name, title, body, body_format, gc_duration_ms) ⇒ Object private
-
#initialize(pointer) ⇒ Transaction
constructor
private
A new instance of Transaction.
-
#record_event(name, title, body, body_format, duration, gc_duration_ms) ⇒ Object
private
rubocop:disable Metrics/ParameterLists.
-
#set_action(action_name) ⇒ Object
private
rubocop:disable Style/AccessorMethodName.
- #set_error(name, message, backtrace) ⇒ Object private
- #set_metadata(key, value) ⇒ Object private
-
#set_namespace(namespace) ⇒ Object
private
rubocop:disable Style/AccessorMethodName.
-
#set_queue_start(time) ⇒ Object
private
rubocop:disable Style/AccessorMethodName.
- #set_sample_data(key, payload) ⇒ Object private
- #start_event(gc_duration_ms) ⇒ Object private
- #to_json ⇒ Object private
Methods included from StringHelpers
#make_appsignal_string, #make_ruby_string
Constructor Details
#initialize(pointer) ⇒ Transaction
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 a new instance of Transaction.
250 251 252 253 254 255 |
# File 'lib/appsignal/extension/jruby.rb', line 250 def initialize(pointer) @pointer = FFI::AutoPointer.new( pointer, Extension.method(:appsignal_free_transaction) ) end |
Instance Attribute Details
#pointer ⇒ Object (readonly)
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.
248 249 250 |
# File 'lib/appsignal/extension/jruby.rb', line 248 def pointer @pointer end |
Instance Method Details
#complete ⇒ 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.
355 356 357 |
# File 'lib/appsignal/extension/jruby.rb', line 355 def complete Extension.appsignal_complete_transaction(pointer) end |
#finish(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.
351 352 353 |
# File 'lib/appsignal/extension/jruby.rb', line 351 def finish(gc_duration_ms) Extension.appsignal_finish_transaction(pointer, gc_duration_ms) end |
#finish_event(name, title, body, body_format, 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.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/appsignal/extension/jruby.rb', line 261 def finish_event(name, title, body, body_format, gc_duration_ms) case body when String method = :appsignal_finish_event body_arg = make_appsignal_string(body) when Data method = :appsignal_finish_event_data body_arg = body.pointer else raise ArgumentError, "body argument should be a String or Appsignal::Extension::Data" end Extension.public_send( method, pointer, make_appsignal_string(name), make_appsignal_string(title), body_arg, body_format, gc_duration_ms ) end |
#record_event(name, title, body, body_format, duration, 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.
rubocop:disable Metrics/ParameterLists
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/appsignal/extension/jruby.rb', line 284 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 Extension.public_send( method, pointer, make_appsignal_string(name), make_appsignal_string(title), body_arg, body_format, duration, gc_duration_ms ) end |
#set_action(action_name) ⇒ 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.
rubocop:disable Style/AccessorMethodName
317 318 319 320 321 322 |
# File 'lib/appsignal/extension/jruby.rb', line 317 def set_action(action_name) # rubocop:disable Style/AccessorMethodName Extension.appsignal_set_transaction_action( pointer, make_appsignal_string(action_name) ) end |
#set_error(name, message, backtrace) ⇒ 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.
308 309 310 311 312 313 314 315 |
# File 'lib/appsignal/extension/jruby.rb', line 308 def set_error(name, , backtrace) Extension.appsignal_set_transaction_error( pointer, make_appsignal_string(name), make_appsignal_string(), backtrace.pointer ) end |
#set_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.
343 344 345 346 347 348 349 |
# File 'lib/appsignal/extension/jruby.rb', line 343 def (key, value) Extension.( pointer, make_appsignal_string(key), make_appsignal_string(value) ) end |
#set_namespace(namespace) ⇒ 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.
rubocop:disable Style/AccessorMethodName
324 325 326 327 328 329 |
# File 'lib/appsignal/extension/jruby.rb', line 324 def set_namespace(namespace) # rubocop:disable Style/AccessorMethodName Extension.appsignal_set_transaction_namespace( pointer, make_appsignal_string(namespace) ) end |
#set_queue_start(time) ⇒ 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.
rubocop:disable Style/AccessorMethodName
339 340 341 |
# File 'lib/appsignal/extension/jruby.rb', line 339 def set_queue_start(time) # rubocop:disable Style/AccessorMethodName Extension.appsignal_set_transaction_queue_start(pointer, time) end |
#set_sample_data(key, payload) ⇒ 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.
331 332 333 334 335 336 337 |
# File 'lib/appsignal/extension/jruby.rb', line 331 def set_sample_data(key, payload) Extension.appsignal_set_transaction_sample_data( pointer, make_appsignal_string(key), payload.pointer ) end |
#start_event(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.
257 258 259 |
# File 'lib/appsignal/extension/jruby.rb', line 257 def start_event(gc_duration_ms) Extension.appsignal_start_event(pointer, gc_duration_ms) end |
#to_json ⇒ 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.
359 360 361 362 |
# File 'lib/appsignal/extension/jruby.rb', line 359 def to_json json = Extension.appsignal_transaction_to_json(pointer) make_ruby_string(json) if json[:len] > 0 end |