Class: Rafflesia::CacheWarmWorkloadResult
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CacheWarmWorkloadResult
- 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
-
#all_cache_hits ⇒ Object
Returns the value of attribute all_cache_hits.
-
#error ⇒ Object
Returns the value of attribute error.
-
#file_count ⇒ Object
Returns the value of attribute file_count.
-
#manifest_id ⇒ Object
Returns the value of attribute manifest_id.
-
#manifest_object_id ⇒ Object
Returns the value of attribute manifest_object_id.
-
#metrics ⇒ Object
Returns the value of attribute metrics.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#segment_roles ⇒ Object
Returns the value of attribute segment_roles.
-
#shard_count ⇒ Object
Returns the value of attribute shard_count.
-
#shards ⇒ Object
Returns the value of attribute shards.
-
#status ⇒ Object
Returns the value of attribute status.
-
#target_dir ⇒ Object
Returns the value of attribute target_dir.
-
#total_size_bytes ⇒ Object
Returns the value of attribute total_size_bytes.
-
#warnings ⇒ Object
Returns the value of attribute warnings.
-
#workload ⇒ Object
Returns the value of attribute workload.
Instance Method Summary collapse
-
#initialize(json) ⇒ CacheWarmWorkloadResult
constructor
A new instance of CacheWarmWorkloadResult.
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_hits ⇒ Object
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 |
#error ⇒ Object
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_count ⇒ Object
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_id ⇒ Object
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_id ⇒ Object
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 |
#metrics ⇒ Object
Returns the value of attribute metrics.
26 27 28 |
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26 def metrics @metrics end |
#ref ⇒ Object
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_roles ⇒ Object
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_count ⇒ Object
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 |
#shards ⇒ Object
Returns the value of attribute shards.
26 27 28 |
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26 def shards @shards end |
#status ⇒ Object
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_dir ⇒ Object
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_bytes ⇒ Object
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 |
#warnings ⇒ Object
Returns the value of attribute warnings.
26 27 28 |
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26 def warnings @warnings end |
#workload ⇒ Object
Returns the value of attribute workload.
26 27 28 |
# File 'lib/rafflesia/cache/cache_warm_workload_result.rb', line 26 def workload @workload end |