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.



1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/sidekiq/api.rb', line 1305

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.



1303
1304
1305
# File 'lib/sidekiq/api.rb', line 1303

def elapsed
  @elapsed
end

#jidObject (readonly)

Returns the value of attribute jid.



1303
1304
1305
# File 'lib/sidekiq/api.rb', line 1303

def jid
  @jid
end

#sizeObject (readonly)

Returns the value of attribute size.



1303
1304
1305
# File 'lib/sidekiq/api.rb', line 1303

def size
  @size
end

#started_atObject (readonly)

Returns the value of attribute started_at.



1303
1304
1305
# File 'lib/sidekiq/api.rb', line 1303

def started_at
  @started_at
end

#tokenObject (readonly)

Returns the value of attribute token.



1303
1304
1305
# File 'lib/sidekiq/api.rb', line 1303

def token
  @token
end

#typeObject (readonly)

Returns the value of attribute type.



1303
1304
1305
# File 'lib/sidekiq/api.rb', line 1303

def type
  @type
end

Instance Method Details

#dataObject



1319
1320
1321
# File 'lib/sidekiq/api.rb', line 1319

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

#keyObject



1315
1316
1317
# File 'lib/sidekiq/api.rb', line 1315

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