Class: Hinoki

Inherits:
Object
  • Object
show all
Defined in:
lib/hinoki/version.rb,
lib/hinoki/base.rb,
lib/hinoki/checks.rb,
lib/hinoki/config.rb,
lib/hinoki/events.rb,
lib/hinoki/clients.rb,
lib/hinoki/stashes.rb,
lib/hinoki/aggregates.rb,
lib/hinoki/connection.rb

Overview

hinoki/version.rb

Defined Under Namespace

Modules: Aggregates, Checks, Clients, Events, Stashes Classes: Config, Connection

Constant Summary collapse

VERSION =
'1.2.0'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host = nil, port = nil) ⇒ Hinoki

Returns a new instance of Hinoki.



13
14
15
16
17
18
19
20
# File 'lib/hinoki/base.rb', line 13

def initialize(host=nil, port=nil)
  @@conn      = Hinoki::Connection.new(host, port)
  @aggregates = Hinoki::Aggregates
  @checks     = Hinoki::Checks
  @clients    = Hinoki::Clients
  @events     = Hinoki::Events
  @stashes    = Hinoki::Stashes
end

Instance Attribute Details

#aggregatesObject

Returns the value of attribute aggregates.



11
12
13
# File 'lib/hinoki/base.rb', line 11

def aggregates
  @aggregates
end

#checksObject

Returns the value of attribute checks.



11
12
13
# File 'lib/hinoki/base.rb', line 11

def checks
  @checks
end

#clientsObject

Returns the value of attribute clients.



11
12
13
# File 'lib/hinoki/base.rb', line 11

def clients
  @clients
end

#eventsObject

Returns the value of attribute events.



11
12
13
# File 'lib/hinoki/base.rb', line 11

def events
  @events
end

#stashesObject

Returns the value of attribute stashes.



11
12
13
# File 'lib/hinoki/base.rb', line 11

def stashes
  @stashes
end

Class Method Details

.connObject

Helper for modules to grab onto the connection



23
24
25
# File 'lib/hinoki/base.rb', line 23

def self.conn
  @@conn
end

Instance Method Details

#health(consumers = 1, messages = 1) ⇒ Object

Delivers information about Sensu and RabbitMQ performance



28
29
30
# File 'lib/hinoki/base.rb', line 28

def health(consumers=1, messages=1)
  return self.conn.get("/health?consumers=#{consumers}&messages=#{messages}")
end

#infoObject

Metadata about the Sensu installation



33
34
35
# File 'lib/hinoki/base.rb', line 33

def info
  return self.conn.get('/info')
end