Class: Cloudwatch::Sender::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudwatch/sender/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, metric_prefix) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
12
13
14
15
# File 'lib/cloudwatch/sender/base.rb', line 6

def initialize(options, metric_prefix)
  @metric_prefix = metric_prefix
  @influxdb = InfluxDB::Client.new "graphite",
    :username    => options["influx_username"],
    :password    => options["influx_password"],
    :use_ssl     => options["influx_ssl"] || false,
    :verify_ssl  => options["influx_verify_ssl"] || false,
    :ssl_ca_cert => options["influx_ssl_ca_cert"] || false,
    :host        => options["influx_host"] || false
end

Instance Attribute Details

#influxdbObject (readonly)

Returns the value of attribute influxdb.



4
5
6
# File 'lib/cloudwatch/sender/base.rb', line 4

def influxdb
  @influxdb
end

#metric_prefixObject (readonly)

Returns the value of attribute metric_prefix.



4
5
6
# File 'lib/cloudwatch/sender/base.rb', line 4

def metric_prefix
  @metric_prefix
end

Instance Method Details

#write_data(data) ⇒ Object



17
18
19
# File 'lib/cloudwatch/sender/base.rb', line 17

def write_data(data)
  influxdb.write_point(metric_prefix, data)
end