class DetailedTrace

{ “version”: 1, “identity”: {

"transaction_id": "req-....",
"revision": "abcdef",
"start_instant": "01-01-01T00:00:00.0000Z",
"stop_instant": "01-01-01T00:00:01.0000Z",
"type": "Web",
"naming": {
  "path": "/users",
  "code": "UsersController#index",
},
"score": {
  "total": 10.5,
  "percentile": 4.5,
  "age": 2.0,
  "memory_delta": 3,
  "allocations": 1
}

},

“tags”: {

"allocations": 1000

},

“spans”: [

...

]

Constants

VERSION

Attributes

age_score[R]
code[R]
duration[R]
host[R]
memory_allocations_score[R]
memory_delta_score[R]
path[R]
percentile_score[R]
revision[R]
spans[R]
start_instant[R]
stop_instant[R]
tags[R]
total_score[R]
transaction_id[R]
type[R]

Public Class Methods

new(transaction_id, revision, host, start_instant, stop_instant, type, path, code, spans, tags) click to toggle source
# File lib/scout_apm/detailed_trace.rb, line 56
def initialize(transaction_id, revision, host, start_instant, stop_instant, type, path, code, spans, tags)
  @spans = spans
  @tags = DetailedTraceTags(tags)

  @transaction_id = transaction_id
  @revision = revision
  @host = host
  @start_instant = start_instant
  @stop_instant = stop_instant
  @type = type

  @path = path
  @code = code

  @total_score = 0
  @percentile_score = 0
  @age_score = 0
  @memory_delta_score = 0
  @memory_allocations_score = 0

end

Public Instance Methods

as_json(*) click to toggle source
# File lib/scout_apm/detailed_trace.rb, line 78
def as_json(*)
  {
    :version => VERSION,
    :identity => {
      :transaction_id => transaction_id,
      :revision => revision,
      :host => host,
      :start_instant => start_instant.iso8601(6),
      :stop_instant => stop_instant.iso8601(6),
      :type => type,
      :naming => {
        :path => path,
        :code => code,
      },
      :score => {
        :total => total_score,
        :percentile => percentile_score,
        :age => age_score,
        :memory_delta => memory_delta_score,
        :allocations => memory_allocations_score,
      }
    },
    :tags => tags.as_json,
    :spans => spans.map{|span| span.as_json},
  }
end
call() click to toggle source

Scorable interface

Needed so we can merge ScoredItemSet instances

# File lib/scout_apm/detailed_trace.rb, line 109
def call
  self
end
name() click to toggle source
# File lib/scout_apm/detailed_trace.rb, line 113
def name
  code
end
score() click to toggle source
# File lib/scout_apm/detailed_trace.rb, line 117
def score
  @total_score
end