Class: LeoManager::StorageStat

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

Overview

Storage Status Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h) ⇒ StorageStat

Returns a new instance of StorageStat.



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/leo_manager_models.rb', line 221

def initialize(h)
  @active_num_of_objects  = h[:active_num_of_objects]
  @total_num_of_objects   = h[:total_num_of_objects]
  @active_size_of_objects = h[:active_size_of_objects]
  @total_size_of_objects  = h[:total_size_of_objects]
  @ratio_of_active_size   = h[:ratio_of_active_size]

  last_compaction_start = h[:last_compaction_start]
  if last_compaction_start == "____-__-__ __:__:__"
    @last_compaction_start = nil # you have never done compaction
  else
    @last_compaction_start = Time.parse(last_compaction_start)
  end

  last_compaction_end = h[:last_compaction_end]
  if last_compaction_end == "____-__-__ __:__:__"
    @last_compaction_end = nil
  else
    @last_compaction_end = Time.parse(last_compaction_end)
  end
end

Instance Attribute Details

#active_num_of_objectsObject (readonly)

Returns the value of attribute active_num_of_objects.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def active_num_of_objects
  @active_num_of_objects
end

#active_size_of_objectsObject (readonly)

Returns the value of attribute active_size_of_objects.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def active_size_of_objects
  @active_size_of_objects
end

#last_compaction_endObject (readonly)

Returns the value of attribute last_compaction_end.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def last_compaction_end
  @last_compaction_end
end

#last_compaction_startObject (readonly)

Returns the value of attribute last_compaction_start.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def last_compaction_start
  @last_compaction_start
end

#ratio_of_active_sizeObject (readonly)

Returns the value of attribute ratio_of_active_size.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def ratio_of_active_size
  @ratio_of_active_size
end

#total_num_of_objectsObject (readonly) Also known as: total_of_objects

Returns the value of attribute total_num_of_objects.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def total_num_of_objects
  @total_num_of_objects
end

#total_size_of_objectsObject (readonly)

Returns the value of attribute total_size_of_objects.



214
215
216
# File 'lib/leo_manager_models.rb', line 214

def total_size_of_objects
  @total_size_of_objects
end

Instance Method Details

#file_sizeObject



243
244
245
# File 'lib/leo_manager_models.rb', line 243

def file_size
  warn "property 'file_size' is deprecated"
end