Class: Gemfire::Statistic
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- Gemfire::Statistic
- Includes:
- Shared::Deletable
- Defined in:
- lib/vas/gemfire/statistics.rb
Overview
A statistic of a cache server
Instance Attribute Summary collapse
-
#last_modified ⇒ Integer
readonly
The last modified stamp of the statistic.
-
#path ⇒ String
readonly
The path of statistic.
-
#size ⇒ Integer
readonly
The size of the statistic.
Attributes included from Shared::Deletable
Attributes inherited from Shared::Resource
Instance Method Summary collapse
-
#content {|chunk| ... } ⇒ void
Retrieves the statistic’s content.
-
#initialize(location, client) ⇒ Statistic
constructor
A new instance of Statistic.
-
#instance ⇒ CacheServerNodeInstance
The statistic’s cache server node instance.
-
#reload ⇒ Object
Reloads the statistic’s details from the server.
-
#to_s ⇒ String
A string representation of the statistic.
Methods included from Shared::Deletable
Constructor Details
#initialize(location, client) ⇒ Statistic
Returns a new instance of Statistic.
44 45 46 47 48 49 50 51 |
# File 'lib/vas/gemfire/statistics.rb', line 44 def initialize(location, client) super(location, client) @path = details['path'] @instance_location = Util::LinkUtils.get_link_href(details, 'cache-server-node-instance') @content_location = Util::LinkUtils.get_link_href(details, 'content') end |
Instance Attribute Details
#last_modified ⇒ Integer (readonly)
Returns the last modified stamp of the statistic.
41 42 43 |
# File 'lib/vas/gemfire/statistics.rb', line 41 def last_modified @last_modified end |
#path ⇒ String (readonly)
Returns the path of statistic.
35 36 37 |
# File 'lib/vas/gemfire/statistics.rb', line 35 def path @path end |
#size ⇒ Integer (readonly)
Returns the size of the statistic.
38 39 40 |
# File 'lib/vas/gemfire/statistics.rb', line 38 def size @size end |
Instance Method Details
#content {|chunk| ... } ⇒ void
This method returns an undefined value.
Retrieves the statistic’s content
70 71 72 |
# File 'lib/vas/gemfire/statistics.rb', line 70 def content(&block) client.get_stream(@content_location, &block) end |
#instance ⇒ CacheServerNodeInstance
Returns The statistic’s cache server node instance.
61 62 63 |
# File 'lib/vas/gemfire/statistics.rb', line 61 def instance @instance ||= CacheServerNodeInstance.new(@instance_location, client) end |
#reload ⇒ Object
Reloads the statistic’s details from the server
54 55 56 57 58 |
# File 'lib/vas/gemfire/statistics.rb', line 54 def reload super @size = details['size'] @last_modified = details['last-modified'] end |
#to_s ⇒ String
Returns a string representation of the statistic.
75 76 77 |
# File 'lib/vas/gemfire/statistics.rb', line 75 def to_s "#<#{self.class} path='#@path' size='#@size' last_modified='#@last_modified'>" end |