Class: RailsPerformance::Models::JobRecord
- Inherits:
-
BaseRecord
- Object
- BaseRecord
- RailsPerformance::Models::JobRecord
- Defined in:
- lib/rails_performance/models/job_record.rb
Instance Attribute Summary collapse
-
#created_ati ⇒ Object
readonly
Returns the value of attribute created_ati.
-
#datetime ⇒ Object
readonly
Returns the value of attribute datetime.
-
#enqueued_ati ⇒ Object
readonly
Returns the value of attribute enqueued_ati.
-
#jid ⇒ Object
readonly
Returns the value of attribute jid.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#start_timei ⇒ Object
readonly
Returns the value of attribute start_timei.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#worker ⇒ Object
readonly
Returns the value of attribute worker.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ JobRecord
constructor
key = job-performance |queue|default |worker|SimpleWorker |jid|7d48fbf20976c224510dbc60 |datetime|20200124T0523 |created_ati|1583146613 |enqueued_ati|1583146613 |start_timei|1583146614 |status|success|END value = JSON.
- #to_h ⇒ Object
Methods inherited from BaseRecord
Constructor Details
#initialize(key, value) ⇒ JobRecord
key = job-performance |queue|default |worker|SimpleWorker |jid|7d48fbf20976c224510dbc60 |datetime|20200124T0523 |created_ati|1583146613 |enqueued_ati|1583146613 |start_timei|1583146614 |status|success|END value = JSON
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rails_performance/models/job_record.rb', line 16 def initialize(key, value) @json = value items = key.split("|") @queue = items[2] @worker = items[4] @jid = items[6] @datetime = items[8] @created_ati = items[10] @enqueued_ati = items[12] @start_timei = items[14] @status = items[16] end |
Instance Attribute Details
#created_ati ⇒ Object (readonly)
Returns the value of attribute created_ati.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def created_ati @created_ati end |
#datetime ⇒ Object (readonly)
Returns the value of attribute datetime.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def datetime @datetime end |
#enqueued_ati ⇒ Object (readonly)
Returns the value of attribute enqueued_ati.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def enqueued_ati @enqueued_ati end |
#jid ⇒ Object (readonly)
Returns the value of attribute jid.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def jid @jid end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def queue @queue end |
#start_timei ⇒ Object (readonly)
Returns the value of attribute start_timei.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def start_timei @start_timei end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def status @status end |
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
4 5 6 |
# File 'lib/rails_performance/models/job_record.rb', line 4 def worker @worker end |
Instance Method Details
#to_h ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rails_performance/models/job_record.rb', line 31 def to_h { queue: queue, worker: worker, jid: jid, datetime: datetime, created_ati: created_ati, enqueued_ati: enqueued_ati, start_timei: start_timei, duration: duration, status: status, message: value['message'] } end |