hallmonitor 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 515e56a7cec5188387c88051f7ef6be3ab963b48
4
- data.tar.gz: be30442a4e44804fbf679630fd4c67893907fa89
3
+ metadata.gz: 2bf8d13dcc1fef8473f9ba94777c6ccdc764f19c
4
+ data.tar.gz: deeab3f14fd9fa69015ed13aaa607edf9239b1d9
5
5
  SHA512:
6
- metadata.gz: 58e504bc5324180efb1af75aae1d73274b43b135fab2eff72788d7f296599454cb908b1c185ccd4560b535cd45aec5daee1fbb11582102b0f3ddc87a88ce33f6
7
- data.tar.gz: 5bb63718cefb76199d649f4b066d05f67d63d738682758f2dc00c3d976d1a3ec4c640f850dd7cb2fd771849da329aadc5e96f1a53a70e4b5dd9169d22cad22e4
6
+ metadata.gz: 814c9f8c30f73f40dd1ad3b474ede958444dfe2b0918fc0de87166dad1259ac3733efe62ca30adbbeb11c658b01ded7b196eadfaad63196e7e4ccd6969d893a1
7
+ data.tar.gz: affa457a4e18eac08dba4d6c4d0f5fc1580534a277b17b475257b7164ba8400d72e1e7f172481545ca91d2b79278ba7987e41956e8f1bdc0548456354f5b260b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # Version 4.0.0
2
+ - Changed initializer signature for InfluxDB outputter to use
3
+ keyword args.
4
+ - Added `attr_accessor` for InfluxDB Outputter's transformer
5
+
1
6
  # Version 3.0.0
2
7
  - Refactored the Transformer concept in the InfluxDB outputter so that
3
8
  it is more flexible. This was in response to the InfluxDB client gem
@@ -10,6 +10,10 @@ module Hallmonitor
10
10
  # Simple EventData struct, used to communicate with an optional Transformer
11
11
  EventData = Struct.new(:name, :tags, :fields)
12
12
 
13
+ # @return [#transform(Event, EventData)] Object used to transform data
14
+ # before it is sent to InfluxDB
15
+ attr_accessor :transformer
16
+
13
17
  # Builds a new Influxdb outputter
14
18
  # @param influxdb_client [InfluxDB::Client] client instance to use
15
19
  # @param tags [Hash] Set of default tags applied to all events output to
@@ -22,7 +26,7 @@ module Hallmonitor
22
26
  # before it is written out to InfluxDB
23
27
  # @raise if influxdb_client does not respond to :write_point
24
28
  # (InfluxDB::Client contract)
25
- def initialize(influxdb_client, tags = {}, transformer = nil)
29
+ def initialize(influxdb_client, tags: {}, transformer: nil)
26
30
  unless influxdb_client.respond_to?(:write_point)
27
31
  raise 'Supplied InfluxDB Client was not as expected'
28
32
  end
@@ -1,6 +1,6 @@
1
1
  module Hallmonitor
2
2
  module Version
3
- MAJOR = 3
3
+ MAJOR = 4
4
4
  MINOR = 0
5
5
  PATCH = 0
6
6
  BUILD = nil
@@ -6,7 +6,7 @@ module Hallmonitor
6
6
  RSpec.describe Influxdb do
7
7
  let(:influxdb_client) { nil }
8
8
  let(:default_tags) { {} }
9
- let(:outputter) { described_class.new(influxdb_client, default_tags) }
9
+ let(:outputter) { described_class.new(influxdb_client, tags: default_tags) }
10
10
 
11
11
  context '#initialize' do
12
12
  context 'with a bad influxdb client' do
@@ -73,7 +73,7 @@ module Hallmonitor
73
73
  context 'with a transformer' do
74
74
  let(:transformer) { double('transformer') }
75
75
  let(:outputter) do
76
- described_class.new(influxdb_client, default_tags, transformer)
76
+ described_class.new(influxdb_client, tags: default_tags, transformer: transformer)
77
77
  end
78
78
 
79
79
  let(:expected_data) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hallmonitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris TenHarmsel