Class: ScoutApm::SlowTransaction
- Inherits:
-
Object
- Object
- ScoutApm::SlowTransaction
- Includes:
- BucketNameSplitter
- Defined in:
- lib/scout_apm/slow_transaction.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#metric_name ⇒ Object
readonly
Returns the value of attribute metric_name.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#prof ⇒ Object
readonly
Returns the value of attribute prof.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#total_call_time ⇒ Object
readonly
Returns the value of attribute total_call_time.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#call ⇒ Object
Scorable interface.
-
#clear_metrics! ⇒ Object
Used to remove metrics when the payload will be too large.
- #context_hash ⇒ Object
- #has_metrics? ⇒ Boolean
-
#initialize(uri, metric_name, total_call_time, metrics, context, time, raw_stackprof, score) ⇒ SlowTransaction
constructor
A new instance of SlowTransaction.
- #name ⇒ Object
- #score ⇒ Object
Methods included from BucketNameSplitter
#bucket_name, #bucket_type, #key
Constructor Details
#initialize(uri, metric_name, total_call_time, metrics, context, time, raw_stackprof, score) ⇒ SlowTransaction
Returns a new instance of SlowTransaction.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/scout_apm/slow_transaction.rb', line 14 def initialize(uri, metric_name, total_call_time, metrics, context, time, raw_stackprof, score) @uri = uri @metric_name = metric_name @total_call_time = total_call_time @metrics = metrics @context = context @time = time @prof = [] @score = score end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
10 11 12 |
# File 'lib/scout_apm/slow_transaction.rb', line 10 def context @context end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
8 9 10 |
# File 'lib/scout_apm/slow_transaction.rb', line 8 def @meta end |
#metric_name ⇒ Object (readonly)
Returns the value of attribute metric_name.
5 6 7 |
# File 'lib/scout_apm/slow_transaction.rb', line 5 def metric_name @metric_name end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
7 8 9 |
# File 'lib/scout_apm/slow_transaction.rb', line 7 def metrics @metrics end |
#prof ⇒ Object (readonly)
Returns the value of attribute prof.
12 13 14 |
# File 'lib/scout_apm/slow_transaction.rb', line 12 def prof @prof end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
11 12 13 |
# File 'lib/scout_apm/slow_transaction.rb', line 11 def time @time end |
#total_call_time ⇒ Object (readonly)
Returns the value of attribute total_call_time.
6 7 8 |
# File 'lib/scout_apm/slow_transaction.rb', line 6 def total_call_time @total_call_time end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
9 10 11 |
# File 'lib/scout_apm/slow_transaction.rb', line 9 def uri @uri end |
Instance Method Details
#as_json ⇒ Object
35 36 37 38 |
# File 'lib/scout_apm/slow_transaction.rb', line 35 def as_json json_attributes = [:key, :time, :total_call_time, :uri, [:context, :context_hash], :prof, :score] ScoutApm::AttributeArranger.call(self, json_attributes) end |
#call ⇒ Object
Scorable interface
Needed so we can merge ScoredItemSet instances
48 49 50 |
# File 'lib/scout_apm/slow_transaction.rb', line 48 def call self end |
#clear_metrics! ⇒ Object
Used to remove metrics when the payload will be too large.
26 27 28 29 |
# File 'lib/scout_apm/slow_transaction.rb', line 26 def clear_metrics! @metrics = nil self end |
#context_hash ⇒ Object
40 41 42 |
# File 'lib/scout_apm/slow_transaction.rb', line 40 def context_hash context.to_hash end |
#has_metrics? ⇒ Boolean
31 32 33 |
# File 'lib/scout_apm/slow_transaction.rb', line 31 def has_metrics? metrics and metrics.any? end |
#name ⇒ Object
52 53 54 |
# File 'lib/scout_apm/slow_transaction.rb', line 52 def name metric_name end |
#score ⇒ Object
56 57 58 |
# File 'lib/scout_apm/slow_transaction.rb', line 56 def score @score end |