influxdb 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/influxdb/timestamp_conversion.rb +3 -3
- data/lib/influxdb/version.rb +1 -1
- data/spec/influxdb/time_conversion_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a35d70ed83c318bad08d7d03f1d65b67953a7fc3277c4a925d59fca5e097dde5
|
4
|
+
data.tar.gz: 4c34876161086123e961d6fa3c43ec808f2ed1024acf205436bdd284f00b756c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e83524fcec1f9a816c05d6f4eb5c5e9d8067beccf25551e628b444d6d568f28aa55f8acb41336263640f143fd17f37e9ccd0289f1c97c670f3edf9b14e433193
|
7
|
+
data.tar.gz: c4c1e66730b9ba1a0dd0529b30f9bbc4b13929674ab0b523952ba5ee2264caa13b712ddf05c91d4262453b32df0559e4f84a37277c136fa8167fbd758329beb0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
For the full commit log, [see here](https://github.com/influxdata/influxdb-ruby/commits/master).
|
4
4
|
|
5
|
+
## v0.6.4, releases 2018-12-02
|
6
|
+
|
7
|
+
- Fix newly introduced `InfluxDB.now(precision)` for precisions larger
|
8
|
+
than "s".
|
9
|
+
|
5
10
|
## v0.6.3, released 2018-11-30
|
6
11
|
|
7
12
|
- Added `InfluxDB.now(precision)` and `InfluxDB::Client#now` as companions
|
@@ -31,7 +31,7 @@ module InfluxDB #:nodoc:
|
|
31
31
|
# InfluxDB.now("m") #=> 25726868
|
32
32
|
# InfluxDB.now("h") #=> 428781
|
33
33
|
def self.now(precision = "s")
|
34
|
-
name, divisor =
|
34
|
+
name, divisor = CLOCK_NAMES.fetch(precision) do
|
35
35
|
raise ArgumentError, "invalid time precision: #{precision}"
|
36
36
|
end
|
37
37
|
|
@@ -56,8 +56,8 @@ module InfluxDB #:nodoc:
|
|
56
56
|
"u" => [:microsecond, 1],
|
57
57
|
"ms" => [:millisecond, 1],
|
58
58
|
"s" => [:second, 1],
|
59
|
-
"m" => [:second,
|
60
|
-
"h" => [:second,
|
59
|
+
"m" => [:second, 60.to_r],
|
60
|
+
"h" => [:second, (60 * 60).to_r],
|
61
61
|
}.freeze
|
62
62
|
private_constant :CLOCK_NAMES
|
63
63
|
end
|
data/lib/influxdb/version.rb
CHANGED
@@ -23,4 +23,23 @@ RSpec.describe InfluxDB do
|
|
23
23
|
.to raise_exception(/invalid time precision.*whatever/i)
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
describe ".now" do
|
28
|
+
{
|
29
|
+
"ns" => [:nanosecond, 1_513_009_229_111_222_333],
|
30
|
+
nil => [:nanosecond, 1_513_009_229_111_222_333],
|
31
|
+
"u" => [:microsecond, 1_513_009_229_111_222],
|
32
|
+
"ms" => [:millisecond, 1_513_009_229_111],
|
33
|
+
"s" => [:second, 1_513_009_229],
|
34
|
+
"m" => [:second, 25_216_820, 1_513_009_229],
|
35
|
+
"h" => [:second, 420_280, 1_513_009_229],
|
36
|
+
}.each do |precision, (name, expected, stub)|
|
37
|
+
it "should return the current time in #{precision.inspect}" do
|
38
|
+
expect(Process).to receive(:clock_gettime)
|
39
|
+
.with(Process::CLOCK_REALTIME, name)
|
40
|
+
.and_return(stub || expected)
|
41
|
+
expect(described_class.now(precision)).to eq(expected)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
26
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: influxdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Persen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|