Class: Rafflesia::CacheWarmData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/cache/cache_warm_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  all_cache_hits: :all_cache_hits,
  continue_on_error: :continue_on_error,
  failed_count: :failed_count,
  object_storage_backends: :object_storage_backends,
  results: :results,
  status: :status,
  succeeded_count: :succeeded_count,
  target_dir: :target_dir,
  total_elapsed_ms: :total_elapsed_ms,
  total_file_count: :total_file_count,
  total_size_bytes: :total_size_bytes,
  verify: :verify,
  workload_count: :workload_count
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CacheWarmData

Returns a new instance of CacheWarmData.



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 39

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @all_cache_hits = hash[:all_cache_hits]
  @continue_on_error = hash[:continue_on_error]
  @failed_count = hash[:failed_count]
  @object_storage_backends = (hash[:object_storage_backends] || [])
  @results = (hash[:results] || []).map { |item| item ? Rafflesia::CacheWarmWorkloadResult.new(item) : nil }
  @status = hash[:status]
  @succeeded_count = hash[:succeeded_count]
  @target_dir = hash[:target_dir]
  @total_elapsed_ms = hash[:total_elapsed_ms]
  @total_file_count = hash[:total_file_count]
  @total_size_bytes = hash[:total_size_bytes]
  @verify = hash[:verify]
  @workload_count = hash[:workload_count]
end

Instance Attribute Details

#all_cache_hitsObject

Returns the value of attribute all_cache_hits.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def all_cache_hits
  @all_cache_hits
end

#continue_on_errorObject

Returns the value of attribute continue_on_error.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def continue_on_error
  @continue_on_error
end

#failed_countObject

Returns the value of attribute failed_count.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def failed_count
  @failed_count
end

#object_storage_backendsObject

Returns the value of attribute object_storage_backends.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def object_storage_backends
  @object_storage_backends
end

#resultsObject

Returns the value of attribute results.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def results
  @results
end

#statusObject

Returns the value of attribute status.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def status
  @status
end

#succeeded_countObject

Returns the value of attribute succeeded_count.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def succeeded_count
  @succeeded_count
end

#target_dirObject

Returns the value of attribute target_dir.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def target_dir
  @target_dir
end

#total_elapsed_msObject

Returns the value of attribute total_elapsed_ms.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def total_elapsed_ms
  @total_elapsed_ms
end

#total_file_countObject

Returns the value of attribute total_file_count.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def total_file_count
  @total_file_count
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def total_size_bytes
  @total_size_bytes
end

#verifyObject

Returns the value of attribute verify.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def verify
  @verify
end

#workload_countObject

Returns the value of attribute workload_count.



24
25
26
# File 'lib/rafflesia/cache/cache_warm_data.rb', line 24

def workload_count
  @workload_count
end