Module: Fflux

Defined in:
lib/fflux.rb,
lib/fflux/version.rb

Constant Summary collapse

VERSION =
"0.2.0"
@@port =
8092
@@host =
'127.0.0.1'

Class Method Summary collapse

Class Method Details

.host=(host) ⇒ Object



31
32
33
# File 'lib/fflux.rb', line 31

def host=(host)
  @@host = host
end

.port=(port) ⇒ Object



27
28
29
# File 'lib/fflux.rb', line 27

def port=(port)
  @@port = port
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Fflux)

    the object that the method was called on



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

def setup
  yield self
end

.write(measurement, values = {}, tags = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fflux.rb', line 11

def write(measurement, values = {}, tags = {})
  Thread.new do
    socket = UDPSocket.new
    socket.send(
      payload(measurement, values, tags),
      0,
      @@host,
      @@port
    )
  end
end