Class: ScoutApm::SlowJobRecord
- Inherits:
-
Object
- Object
- ScoutApm::SlowJobRecord
- Defined in:
- lib/scout_apm/slow_job_record.rb
Instance Attribute Summary collapse
-
#allocation_metrics ⇒ Object
readonly
Returns the value of attribute allocation_metrics.
-
#allocations ⇒ Object
readonly
Returns the value of attribute allocations.
-
#context ⇒ Object
readonly
What else interesting did we learn?.
-
#exclusive_time ⇒ Object
readonly
Returns the value of attribute exclusive_time.
-
#git_sha ⇒ Object
readonly
Returns the value of attribute git_sha.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#job_name ⇒ Object
readonly
Returns the value of attribute job_name.
-
#mem_delta ⇒ Object
readonly
Returns the value of attribute mem_delta.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#queue_name ⇒ Object
readonly
Returns the value of attribute queue_name.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#seconds_since_startup ⇒ Object
readonly
Returns the value of attribute seconds_since_startup.
-
#span_trace ⇒ Object
readonly
Returns the value of attribute span_trace.
-
#time ⇒ Object
readonly
When did this job occur.
-
#total_time ⇒ Object
(also: #total_call_time)
readonly
Returns the value of attribute total_time.
-
#truncated_metrics ⇒ Object
readonly
Returns the value of attribute truncated_metrics.
Instance Method Summary collapse
-
#call ⇒ Object
Scorable interface.
-
#initialize(agent_context, queue_name, job_name, time, total_time, exclusive_time, context, metrics, allocation_metrics, mem_delta, allocations, score, truncated_metrics, span_trace) ⇒ SlowJobRecord
constructor
A new instance of SlowJobRecord.
- #metric_name ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(agent_context, queue_name, job_name, time, total_time, exclusive_time, context, metrics, allocation_metrics, mem_delta, allocations, score, truncated_metrics, span_trace) ⇒ SlowJobRecord
Returns a new instance of SlowJobRecord.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/scout_apm/slow_job_record.rb', line 28 def initialize(agent_context, queue_name, job_name, time, total_time, exclusive_time, context, metrics, allocation_metrics, mem_delta, allocations, score, truncated_metrics, span_trace) @queue_name = queue_name @job_name = job_name @time = time @total_time = total_time @exclusive_time = exclusive_time @context = context @metrics = metrics @allocation_metrics = allocation_metrics @mem_delta = mem_delta @allocations = allocations @seconds_since_startup = (Time.now - agent_context.process_start_time) @hostname = agent_context.environment.hostname @git_sha = agent_context.environment.git_revision.sha @score = score @truncated_metrics = truncated_metrics @span_trace = span_trace agent_context.logger.debug { "Slow Job [#{metric_name}] - Call Time: #{total_call_time} Mem Delta: #{mem_delta}"} end |
Instance Attribute Details
#allocation_metrics ⇒ Object (readonly)
Returns the value of attribute allocation_metrics.
17 18 19 |
# File 'lib/scout_apm/slow_job_record.rb', line 17 def allocation_metrics @allocation_metrics end |
#allocations ⇒ Object (readonly)
Returns the value of attribute allocations.
19 20 21 |
# File 'lib/scout_apm/slow_job_record.rb', line 19 def allocations @allocations end |
#context ⇒ Object (readonly)
What else interesting did we learn?
10 11 12 |
# File 'lib/scout_apm/slow_job_record.rb', line 10 def context @context end |
#exclusive_time ⇒ Object (readonly)
Returns the value of attribute exclusive_time.
13 14 15 |
# File 'lib/scout_apm/slow_job_record.rb', line 13 def exclusive_time @exclusive_time end |
#git_sha ⇒ Object (readonly)
Returns the value of attribute git_sha.
23 24 25 |
# File 'lib/scout_apm/slow_job_record.rb', line 23 def git_sha @git_sha end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
20 21 22 |
# File 'lib/scout_apm/slow_job_record.rb', line 20 def hostname @hostname end |
#job_name ⇒ Object (readonly)
Returns the value of attribute job_name.
4 5 6 |
# File 'lib/scout_apm/slow_job_record.rb', line 4 def job_name @job_name end |
#mem_delta ⇒ Object (readonly)
Returns the value of attribute mem_delta.
18 19 20 |
# File 'lib/scout_apm/slow_job_record.rb', line 18 def mem_delta @mem_delta end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
16 17 18 |
# File 'lib/scout_apm/slow_job_record.rb', line 16 def metrics @metrics end |
#queue_name ⇒ Object (readonly)
Returns the value of attribute queue_name.
3 4 5 |
# File 'lib/scout_apm/slow_job_record.rb', line 3 def queue_name @queue_name end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
22 23 24 |
# File 'lib/scout_apm/slow_job_record.rb', line 22 def score @score end |
#seconds_since_startup ⇒ Object (readonly)
Returns the value of attribute seconds_since_startup.
21 22 23 |
# File 'lib/scout_apm/slow_job_record.rb', line 21 def seconds_since_startup @seconds_since_startup end |
#span_trace ⇒ Object (readonly)
Returns the value of attribute span_trace.
26 27 28 |
# File 'lib/scout_apm/slow_job_record.rb', line 26 def span_trace @span_trace end |
#time ⇒ Object (readonly)
When did this job occur
7 8 9 |
# File 'lib/scout_apm/slow_job_record.rb', line 7 def time @time end |
#total_time ⇒ Object (readonly) Also known as: total_call_time
Returns the value of attribute total_time.
12 13 14 |
# File 'lib/scout_apm/slow_job_record.rb', line 12 def total_time @total_time end |
#truncated_metrics ⇒ Object (readonly)
Returns the value of attribute truncated_metrics.
24 25 26 |
# File 'lib/scout_apm/slow_job_record.rb', line 24 def truncated_metrics @truncated_metrics end |
Instance Method Details
#call ⇒ Object
Scorable interface
Needed so we can merge ScoredItemSet instances
58 59 60 |
# File 'lib/scout_apm/slow_job_record.rb', line 58 def call self end |
#metric_name ⇒ Object
50 51 52 |
# File 'lib/scout_apm/slow_job_record.rb', line 50 def metric_name "Job/#{queue_name}/#{job_name}" end |
#name ⇒ Object
62 63 64 |
# File 'lib/scout_apm/slow_job_record.rb', line 62 def name metric_name end |