Class: LeoFSManager::StorageStat

Inherits:
Object
  • Object
show all
Defined in:
lib/leofs_manager_client/leofs_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.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 132

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.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

def active_num_of_objects
  @active_num_of_objects
end

#active_size_of_objectsObject (readonly)

Returns the value of attribute active_size_of_objects.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

def active_size_of_objects
  @active_size_of_objects
end

#last_compaction_endObject (readonly)

Returns the value of attribute last_compaction_end.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

def last_compaction_end
  @last_compaction_end
end

#last_compaction_startObject (readonly)

Returns the value of attribute last_compaction_start.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

def last_compaction_start
  @last_compaction_start
end

#ratio_of_active_sizeObject (readonly)

Returns the value of attribute ratio_of_active_size.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

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.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

def total_num_of_objects
  @total_num_of_objects
end

#total_size_of_objectsObject (readonly)

Returns the value of attribute total_size_of_objects.



125
126
127
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 125

def total_size_of_objects
  @total_size_of_objects
end

Instance Method Details

#file_sizeObject



154
155
156
# File 'lib/leofs_manager_client/leofs_manager_models.rb', line 154

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