Class: Triglav::Agent::Base::Monitor

Inherits:
Object
  • Object
show all
Defined in:
lib/triglav/agent/base/monitor.rb

Overview

An abstract class of Monitor.

Monitor your storage and send messages to triglav.

You have to implement following methods:

  • initialize

  • process

An instance is created per a `resource`. Connection is shared among same `resource_uri_prefix`.

Note that multiple instances would be created, one instance for one parallel thread basically, and `#process` is ran concurrently.

Instance Method Summary collapse

Constructor Details

#initialize(connection, resource) ⇒ Monitor

Returns a new instance of Monitor

Parameters:

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/triglav/agent/base/monitor.rb', line 21

def initialize(connection, resource)
  raise NotImplementedError
end

Instance Method Details

#process {|events| ... } ⇒ Object

Yields:

  • (events)

    Gives an array of events

Raises:

  • (NotImplementedError)


26
27
28
29
# File 'lib/triglav/agent/base/monitor.rb', line 26

def process(&block)
  raise NotImplementedError
  # yield(events) if block_given?
end