Class: Gemfire::Statistic

Inherits:
Shared::Resource show all
Defined in:
lib/vas/gemfire/statistics.rb

Overview

A statistic of a cache server

Instance Attribute Summary collapse

Attributes inherited from Shared::Resource

#location, #security

Instance Method Summary collapse

Constructor Details

#initialize(location, client) ⇒ Statistic

Returns a new instance of Statistic.



44
45
46
47
48
49
50
51
52
53
# File 'lib/vas/gemfire/statistics.rb', line 44

def initialize(location, client)
  super(location, client)

  @last_modified = details['last-modified']
  @path = details['path']
  @size = details['size']

  @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

#instanceObject (readonly)

The statistic’s cache server node instance



42
43
44
# File 'lib/vas/gemfire/statistics.rb', line 42

def instance
  @instance
end

#last_modifiedObject (readonly)

The last modified time of the disk store



33
34
35
# File 'lib/vas/gemfire/statistics.rb', line 33

def last_modified
  @last_modified
end

#pathObject (readonly)

The path of statistic



36
37
38
# File 'lib/vas/gemfire/statistics.rb', line 36

def path
  @path
end

#sizeObject (readonly)

The size of the statistic



39
40
41
# File 'lib/vas/gemfire/statistics.rb', line 39

def size
  @size
end

Instance Method Details

#content(&block) ⇒ Object

Retrieves the statistic’s content and passes it to the block



56
57
58
# File 'lib/vas/gemfire/statistics.rb', line 56

def content(&block)
  client.get_stream(@content_location, &block)
end

#to_sObject



60
61
62
# File 'lib/vas/gemfire/statistics.rb', line 60

def to_s
  "#<#{self.class} path='#@path'>"
end