influxdb 0.2.5 → 0.2.6
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 +4 -4
- data/Rakefile +22 -1
- data/lib/influxdb/point_value.rb +7 -3
- data/lib/influxdb/version.rb +1 -1
- data/spec/influxdb/point_value_spec.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 122c637f20d98ea27ff046720c702d3bf18b8ff5
|
4
|
+
data.tar.gz: bc260fe3b1a9bdaf45e517567f7d1a968a464e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef62b971bf3165b918c96699cb3493193d9883b5378f773b8b1ae9204ac5cf6173ef23dcb27b554d10fc61b069a743205fc930684103a9d0daf19e773fa14bd5
|
7
|
+
data.tar.gz: 70094c9a541fd931329bf6240cf809333a2ce4a7b58f6052bb36bf29bbf5a2b89f10e5d90086cb6b8d743517cc12ae23907e5eccdecfd0e91057294a70cce8df
|
data/Rakefile
CHANGED
@@ -13,5 +13,26 @@ end
|
|
13
13
|
task default: :spec
|
14
14
|
|
15
15
|
task :console do
|
16
|
-
|
16
|
+
lib = File.expand_path('../lib', __FILE__)
|
17
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
18
|
+
require "influxdb"
|
19
|
+
|
20
|
+
begin
|
21
|
+
require "pry-byebug"
|
22
|
+
Pry.start
|
23
|
+
rescue LoadError
|
24
|
+
puts <<-TEXT.gsub(/^\s{6}([^ ])/, '\1')
|
25
|
+
Could not load pry-byebug. Create a file Gemfile.local with
|
26
|
+
the following line, if you want to get rid of this message:
|
27
|
+
|
28
|
+
\tgem "pry-byebug"
|
29
|
+
|
30
|
+
(don't forget to run bundle afterwards). Falling back to IRB.
|
31
|
+
|
32
|
+
TEXT
|
33
|
+
|
34
|
+
require "irb"
|
35
|
+
ARGV.clear
|
36
|
+
IRB.start
|
37
|
+
end
|
17
38
|
end
|
data/lib/influxdb/point_value.rb
CHANGED
@@ -60,11 +60,15 @@ module InfluxDB
|
|
60
60
|
|
61
61
|
def escape_tags(tags)
|
62
62
|
return if tags.nil?
|
63
|
-
|
63
|
+
|
64
|
+
tags = tags.map do |k, v|
|
64
65
|
key = escape(k.to_s, :tag_key)
|
65
66
|
val = escape(v.to_s, :tag_value)
|
66
|
-
|
67
|
-
|
67
|
+
|
68
|
+
"#{key}=#{val}" unless key == "" || val == ""
|
69
|
+
end.compact
|
70
|
+
|
71
|
+
tags.join(",") unless tags.empty?
|
68
72
|
end
|
69
73
|
end
|
70
74
|
end
|
data/lib/influxdb/version.rb
CHANGED
@@ -57,5 +57,18 @@ describe InfluxDB::PointValue do
|
|
57
57
|
expect(point.dump).to eq(expected_value)
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
context "empty tag values" do
|
62
|
+
let(:expected_value) do
|
63
|
+
"responses,region=eu value=5"
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should be omitted" do
|
67
|
+
point = InfluxDB::PointValue.new(series: "responses",
|
68
|
+
values: { value: 5 },
|
69
|
+
tags: { region: "eu", status: nil, other: "", nil => "ignored", "" => "ignored" })
|
70
|
+
expect(point.dump).to eq(expected_value)
|
71
|
+
end
|
72
|
+
end
|
60
73
|
end
|
61
74
|
end
|