Class: Rafflesia::CacheWarmWorkloadResult

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

Constant Summary collapse

HASH_ATTRS =
{
  all_cache_hits: :all_cache_hits,
  error: :error,
  file_count: :file_count,
  manifest_id: :manifest_id,
  manifest_object_id: :manifest_object_id,
  metrics: :metrics,
  ref: :ref,
  segment_roles: :segment_roles,
  shard_count: :shard_count,
  shards: :shards,
  status: :status,
  target_dir: :target_dir,
  total_size_bytes: :total_size_bytes,
  warnings: :warnings,
  workload: :workload
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CacheWarmWorkloadResult

Returns a new instance of CacheWarmWorkloadResult.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 43

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @all_cache_hits = hash[:all_cache_hits]
  @error = hash[:error]
  @file_count = hash[:file_count]
  @manifest_id = hash[:manifest_id]
  @manifest_object_id = hash[:manifest_object_id]
  @metrics = hash[:metrics] ? Rafflesia::CacheMaterializationMetrics.new(hash[:metrics]) : nil
  @ref = hash[:ref]
  @segment_roles = (hash[:segment_roles] || [])
  @shard_count = hash[:shard_count]
  @shards = (hash[:shards] || [])
  @status = hash[:status]
  @target_dir = hash[:target_dir]
  @total_size_bytes = hash[:total_size_bytes]
  @warnings = (hash[:warnings] || []).map { |item| item ? Rafflesia::SearchWarning.new(item) : nil }
  @workload = hash[:workload]
end

Instance Attribute Details

#all_cache_hitsObject

Returns the value of attribute all_cache_hits.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def all_cache_hits
  @all_cache_hits
end

#errorObject

Returns the value of attribute error.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def error
  @error
end

#file_countObject

Returns the value of attribute file_count.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def file_count
  @file_count
end

#manifest_idObject

Returns the value of attribute manifest_id.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def manifest_id
  @manifest_id
end

#manifest_object_idObject

Returns the value of attribute manifest_object_id.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def manifest_object_id
  @manifest_object_id
end

#metricsObject

Returns the value of attribute metrics.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def metrics
  @metrics
end

#refObject

Returns the value of attribute ref.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def ref
  @ref
end

#segment_rolesObject

Returns the value of attribute segment_roles.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def segment_roles
  @segment_roles
end

#shard_countObject

Returns the value of attribute shard_count.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def shard_count
  @shard_count
end

#shardsObject

Returns the value of attribute shards.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def shards
  @shards
end

#statusObject

Returns the value of attribute status.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def status
  @status
end

#target_dirObject

Returns the value of attribute target_dir.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def target_dir
  @target_dir
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def total_size_bytes
  @total_size_bytes
end

#warningsObject

Returns the value of attribute warnings.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def warnings
  @warnings
end

#workloadObject

Returns the value of attribute workload.



26
27
28
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26

def workload
  @workload
end