embulk-output-influxdb 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd1ac581900456f6a43fcfb3ddd7276526fc2764
4
- data.tar.gz: 7b3bc69eb29a6bac858236853ae4e09382c6ad57
3
+ metadata.gz: c10ec1959bc7881942ba8c3e6a931c2873b224ee
4
+ data.tar.gz: b50bbf47ebd9ebd3946337cab7153b219091ecb0
5
5
  SHA512:
6
- metadata.gz: d0f949ab9a638167771aed41f4c4a8ff338f3b60597ac225562105bdde59926dff07fcc4b71c7b6decd7f1e9fd161c03317c4b4c4be16f0568327aac1f283ca8
7
- data.tar.gz: 21984a22409343d5c896850fc1f52e0febcd2e766b481df7f494d08edfe0246d9a6305c4f721a19c718d574ccb8f0709c4fa02c3d40529fcaa0d0df78975653f
6
+ metadata.gz: 68fa2e1e642566fae94df91fe29905b43af498894d7749dffff1afc147640f091283430b40eb9d4e0b415e4a952795a68f670e4430b7f01e924c028d266ba2d5
7
+ data.tar.gz: 07a4b354f8fecd27a62f2b5445a6f3a09b0f9e6f3f8d86336c62e50821e522b05b80916c01dd66802e00ac74b7fbab9081d1a9d25bf276e73bcf3d9fa7c56926
data/README.md CHANGED
@@ -44,6 +44,9 @@ out:
44
44
  - key_name
45
45
  ```
46
46
 
47
+ ## ToDo
48
+ - tags support
49
+ - column_options support
47
50
 
48
51
  ## Build
49
52
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-output-influxdb"
4
- spec.version = "0.1.0"
4
+ spec.version = "0.1.1"
5
5
  spec.authors = ["joker1007"]
6
6
  spec.summary = "InfluxDB output plugin for Embulk"
7
7
  spec.description = "Dumps records to InfluxDB."
@@ -10,8 +10,8 @@ module Embulk
10
10
  def self.transaction(config, schema, count, &control)
11
11
  # configuration code:
12
12
  task = {
13
- "host" => config.param("host", :string, default: "localhost"),
14
- "hosts" => config.param("hosts", :array, default: "localhost"),
13
+ "host" => config.param("host", :string, default: nil),
14
+ "hosts" => config.param("hosts", :array, default: nil),
15
15
  "port" => config.param("port", :integer, default: 8086),
16
16
  "username" => config.param("username", :string, default: "root"),
17
17
  "password" => config.param("password", :string, default: "root"),
@@ -58,6 +58,7 @@ module Embulk
58
58
 
59
59
  def init
60
60
  # initialization code:
61
+ task["hosts"] ||= Array(task["host"] || "localhost")
61
62
  @database = task["database"]
62
63
  @series = task["series"]
63
64
  @series_per_column = task["series_per_column"]
@@ -142,7 +143,10 @@ module Embulk
142
143
  end
143
144
 
144
145
  def find_measurement(series)
145
- @connection.query("SHOW MEASUREMENTS")[0]["values"].find { |v| v["name"] == series }
146
+ result = @connection.query("SHOW MEASUREMENTS")[0]
147
+ if result
148
+ result["values"].find { |v| v["name"] == series }
149
+ end
146
150
  end
147
151
 
148
152
  def create_database_if_not_exist
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-14 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: embulk