Class: Gemfire::Statistic
- Inherits:
-
Shared::Resource
- Object
- Shared::Resource
- Gemfire::Statistic
- Defined in:
- lib/vas/gemfire/statistics.rb
Overview
A statistic of a cache server
Instance Attribute Summary collapse
-
#instance ⇒ CacheServerNodeInstance
readonly
The statistic’s cache server node instance.
-
#path ⇒ String
readonly
The path of statistic.
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.
-
#last_modified ⇒ Integer
The last modified stamp of the statistic.
-
#size ⇒ Integer
The size of the statistic.
-
#to_s ⇒ String
A string representation of the statistic.
Constructor Details
#initialize(location, client) ⇒ Statistic
Returns a new instance of Statistic.
39 40 41 42 43 44 45 46 |
# File 'lib/vas/gemfire/statistics.rb', line 39 def initialize(location, client) super(location, client) @path = details['path'] @instance = CacheServerNodeInstance.new(Util::LinkUtils.get_link_href(details, 'cache-server-node-instance'), client) @content_location = Util::LinkUtils.get_link_href(details, 'content') end |
Instance Attribute Details
#instance ⇒ CacheServerNodeInstance (readonly)
Returns The statistic’s cache server node instance.
36 37 38 |
# File 'lib/vas/gemfire/statistics.rb', line 36 def instance @instance end |
#path ⇒ String (readonly)
Returns the path of statistic.
33 34 35 |
# File 'lib/vas/gemfire/statistics.rb', line 33 def path @path end |
Instance Method Details
#content {|chunk| ... } ⇒ void
This method returns an undefined value.
Retrieves the statistic’s content
63 64 65 |
# File 'lib/vas/gemfire/statistics.rb', line 63 def content(&block) client.get_stream(@content_location, &block) end |
#last_modified ⇒ Integer
Returns the last modified stamp of the statistic.
54 55 56 |
# File 'lib/vas/gemfire/statistics.rb', line 54 def last_modified client.get(location)['last-modified'] end |
#size ⇒ Integer
Returns the size of the statistic.
49 50 51 |
# File 'lib/vas/gemfire/statistics.rb', line 49 def size client.get(location)['size'] end |
#to_s ⇒ String
Returns a string representation of the statistic.
68 69 70 |
# File 'lib/vas/gemfire/statistics.rb', line 68 def to_s "#<#{self.class} path='#@path'>" end |