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.



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/leo_manager_models.rb', line 182

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.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

def active_num_of_objects
  @active_num_of_objects
end

#active_size_of_objectsObject (readonly)

Returns the value of attribute active_size_of_objects.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

def active_size_of_objects
  @active_size_of_objects
end

#last_compaction_endObject (readonly)

Returns the value of attribute last_compaction_end.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

def last_compaction_end
  @last_compaction_end
end

#last_compaction_startObject (readonly)

Returns the value of attribute last_compaction_start.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

def last_compaction_start
  @last_compaction_start
end

#ratio_of_active_sizeObject (readonly)

Returns the value of attribute ratio_of_active_size.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

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.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

def total_num_of_objects
  @total_num_of_objects
end

#total_size_of_objectsObject (readonly)

Returns the value of attribute total_size_of_objects.



175
176
177
# File 'lib/leo_manager_models.rb', line 175

def total_size_of_objects
  @total_size_of_objects
end

Instance Method Details

#file_sizeObject



204
205
206
# File 'lib/leo_manager_models.rb', line 204

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