Class: Sidekiq::ProfileRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arr) ⇒ ProfileRecord

Returns a new instance of ProfileRecord.



1328
1329
1330
1331
1332
1333
1334
1335
1336
# File 'lib/sidekiq/api.rb', line 1328

def initialize(arr)
  # Must be same order as fetch_keys above
  @started_at = Time.at(Integer(arr[0]))
  @jid = arr[1]
  @type = arr[2]
  @token = arr[3]
  @size = Integer(arr[4])
  @elapsed = Float(arr[5])
end

Instance Attribute Details

#elapsedObject (readonly)

Returns the value of attribute elapsed.



1326
1327
1328
# File 'lib/sidekiq/api.rb', line 1326

def elapsed
  @elapsed
end

#jidObject (readonly)

Returns the value of attribute jid.



1326
1327
1328
# File 'lib/sidekiq/api.rb', line 1326

def jid
  @jid
end

#sizeObject (readonly)

Returns the value of attribute size.



1326
1327
1328
# File 'lib/sidekiq/api.rb', line 1326

def size
  @size
end

#started_atObject (readonly)

Returns the value of attribute started_at.



1326
1327
1328
# File 'lib/sidekiq/api.rb', line 1326

def started_at
  @started_at
end

#tokenObject (readonly)

Returns the value of attribute token.



1326
1327
1328
# File 'lib/sidekiq/api.rb', line 1326

def token
  @token
end

#typeObject (readonly)

Returns the value of attribute type.



1326
1327
1328
# File 'lib/sidekiq/api.rb', line 1326

def type
  @type
end

Instance Method Details

#dataObject



1342
1343
1344
# File 'lib/sidekiq/api.rb', line 1342

def data
  Sidekiq.redis { |c| c.hget(key, "data") }
end

#keyObject



1338
1339
1340
# File 'lib/sidekiq/api.rb', line 1338

def key
  "#{token}-#{jid}"
end