Class: ScoutApm::SlowJobRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/scout_apm/slow_job_record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(queue_name, job_name, time, total_time, exclusive_time, context, metrics, score) ⇒ SlowJobRecord

Returns a new instance of SlowJobRecord.



20
21
22
23
24
25
26
27
28
29
# File 'lib/scout_apm/slow_job_record.rb', line 20

def initialize(queue_name, job_name, time, total_time, exclusive_time, context, metrics, score)
  @queue_name = queue_name
  @job_name = job_name
  @time = time
  @total_time = total_time
  @exclusive_time = exclusive_time
  @context = context
  @metrics = metrics
  @score = score
end

Instance Attribute Details

#contextObject (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_timeObject (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

#job_nameObject (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

#metricsObject (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_nameObject (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

#scoreObject (readonly)

Returns the value of attribute score.



18
19
20
# File 'lib/scout_apm/slow_job_record.rb', line 18

def score
  @score
end

#timeObject (readonly)

When did this job occur



7
8
9
# File 'lib/scout_apm/slow_job_record.rb', line 7

def time
  @time
end

#total_timeObject (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

Instance Method Details

#callObject

Scorable interface

Needed so we can merge ScoredItemSet instances



39
40
41
# File 'lib/scout_apm/slow_job_record.rb', line 39

def call
  self
end

#metric_nameObject



31
32
33
# File 'lib/scout_apm/slow_job_record.rb', line 31

def metric_name
  "Job/#{queue_name}/#{job_name}"
end

#nameObject



43
44
45
# File 'lib/scout_apm/slow_job_record.rb', line 43

def name
  metric_name
end