Class: StackifyRubyAPM::Serializers::Transactions Private

Inherits:
Serializer
  • Object
show all
Includes:
Log
Defined in:
lib/stackify_apm/serializers/transactions.rb

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.

Constant Summary

Constants included from Log

Log::PREFIX

Instance Method Summary collapse

Methods included from Log

#debug, #error, #fatal, #info, #log, #warn

Methods inherited from Serializer

#initialize

Constructor Details

This class inherits a constructor from StackifyRubyAPM::Serializers::Serializer

Instance Method Details

#build(config, transaction) ⇒ 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.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/stackify_apm/serializers/transactions.rb', line 11

def build(config, transaction)
  root_span_json = {
    id: -1,
    call: transaction.name,
    reqBegin: transaction.timestamp,
    reqEnd: transaction.duration,
    props: RootInfo.build(config, transaction),
    exceptions: transaction.exceptions,
    stacks: []
  }

  # serialize all the spans
  children_spans_json = []
  transaction.spans.each do |span|
    children_spans_json.push(build_span(span))
  end

  add_children_spans(root_span_json, children_spans_json)
  root_span_json
end