SimpleDB can report on the amount of data stored in a domain, the number of items, etc.
@example
sdb = SimpleDB.new sdb.domains['mydomain'].metadata.to_h # the hash returned above might look like: { :timestamp => 1300841880, :attribute_names_size_bytes => 12, :item_count => 1, :attribute_value_count => 6, :attribute_values_size_bytes => 25, :item_names_size_bytes => 3, :attribute_name_count => 3 }
@private
@return [Domain] The domain this metadata is describing.
@param [Domain] The domain to fetch metadata for. @return [DomainMetadata]
# File lib/aws/simple_db/domain_metadata.rb, line 53 def initialize domain, options = {} @domain = domain super end
@return [Integer] The number of unique attribute names in the
{#domain}.
# File lib/aws/simple_db/domain_metadata.rb, line 74 def attribute_name_count self.to_h[:attribute_name_count] end
@return [Integer] The total size of all unique attribute names,
in bytes.
# File lib/aws/simple_db/domain_metadata.rb, line 80 def attribute_names_size_bytes self.to_h[:attribute_names_size_bytes] end
@return [Integer] The number of all attribute name/value pairs in
the {#domain}.
# File lib/aws/simple_db/domain_metadata.rb, line 86 def attribute_value_count self.to_h[:attribute_value_count] end
@return [Integer] The total size of all attribute values, in bytes.
# File lib/aws/simple_db/domain_metadata.rb, line 91 def attribute_values_size_bytes self.to_h[:attribute_values_size_bytes] end
@return [Integer] The number of all items in the {domain}.
# File lib/aws/simple_db/domain_metadata.rb, line 62 def item_count self.to_h[:item_count] end
@return [Integer] The total size of all item names in the {domain},
in bytes.
# File lib/aws/simple_db/domain_metadata.rb, line 68 def item_names_size_bytes self.to_h[:item_names_size_bytes] end
@return [Integer] The data and time when metadata was calculated
in Epoch (UNIX) time.
# File lib/aws/simple_db/domain_metadata.rb, line 97 def timestamp self.to_h[:timestamp] end
@return [Hash] A hash of all of the metadata attributes for
this {#domain}.
# File lib/aws/simple_db/domain_metadata.rb, line 103 def to_h meta = client.domain_metadata(:domain_name => domain.name) ATTRIBUTES.inject({}) {|h,attr| h[attr] = meta.send(attr); h } end