sidekiq-influxdb 1.1.0 → 1.2.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
  SHA256:
3
- metadata.gz: 5e26bc1a2de9210af75cbc266a5197f170b7374e5a109820f9dd076bf847ec8a
4
- data.tar.gz: a05a88279bdae39185380075048a900f240d4c81ad628211fc23e1942cec8645
3
+ metadata.gz: 296e82fa67ee8923029ede73aeb7e01ced718a7a54f45c2f8b4474995e005676
4
+ data.tar.gz: e82b65aa52eb9410ad4a0d3d0993ffa50061b5f27cb5d20b5b5449e4336fcfe7
5
5
  SHA512:
6
- metadata.gz: '029e5530849733e61978a3a410a6431afd3c4556e72a354520a4c4840f0072dcb4686676891f5fd9c7b1c9af6ea5dc90fffbbdc6700d56ced618da16a5e3f6b0'
7
- data.tar.gz: 3a8e64dae705c33c18543a0f009235183789d7249532289da98ff85b33bbc6ae622f083825fd2927bc826f77914b002ccda7fe621b3861ec67a34a941accb62f
6
+ metadata.gz: 074c2ce097b58a2cb91e77094aa2d9da42d841f5ef2ee8ff8e662f1d417546c5bc46bff5fb499b7b85d5e0809e525a2bcb5b065209cd8a6d22e0a3b9721fe2d5
7
+ data.tar.gz: a3cb6f42f17fa9e15c6b15036b52a87b0e8311a5d0fbd29e9680809fe99b42caa6f21e321898a0e9f9f90432d15844563d0badab0683cedd46274080de6289d7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Sidekiq-InfluxDB Changelog
2
2
 
3
+ ## 1.2.0 (2019-05-03)
4
+
5
+ * Support all InfluxDB time resolutions (added `ns`, `m`, `h`)
6
+
3
7
  ## 1.1.0 (2018-09-03)
4
8
 
5
9
  * ActiveJob support added
data/README.md CHANGED
@@ -10,14 +10,6 @@ Add this gem to your application's `Gemfile`:
10
10
 
11
11
  ## Usage
12
12
 
13
- Sidekiq middleware description:
14
-
15
- https://github.com/mperham/sidekiq/wiki/Middleware
16
-
17
- InfluxDB client description:
18
-
19
- https://github.com/influxdata/influxdb-ruby/blob/master/README.md
20
-
21
13
  Add included middleware to your application's Sidekiq middleware stack:
22
14
 
23
15
  ```ruby
@@ -51,7 +43,7 @@ When you deploy this code, you will start getting the following series in your I
51
43
 
52
44
  Tags (repetitive, indexed data — for filtering and grouping by):
53
45
 
54
- * `time` — Standard InfluxDB timestamp. Precision of the supplied client is respected. Only `s`, `ms`, and `u` precisions are supported.
46
+ * `time` — Standard InfluxDB timestamp. Precision of the supplied client is respected.
55
47
  * `queue` — Queue name.
56
48
  * `class` — Job class name. Classes from `except:` keyword argument are skipped (no data is sent to InfluxDB).
57
49
  * `event` — What happened to the job at the specified `time`: `start`, `finish`, or `error`. If you initialize the middleware with `start_events: false`, there will be no `start` events.
@@ -87,6 +79,9 @@ Et cetera.
87
79
 
88
80
  ## Development
89
81
 
82
+ * [Sidekiq middleware](https://github.com/mperham/sidekiq/wiki/Middleware)
83
+ * [InfluxDB client](https://github.com/influxdata/influxdb-ruby)
84
+
90
85
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
91
86
 
92
87
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module InfluxDB
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -70,9 +70,12 @@ module Sidekiq
70
70
  def in_correct_precision(t)
71
71
  case precision
72
72
  # In order of probability in real-world setups
73
- when 'ms' then (t * 1000).to_i
73
+ when 'ms' then (t * 1_000).to_i
74
74
  when 's' then t.to_i
75
- when 'u' then (t * 1000000).to_i
75
+ when 'u' then (t * 1_000_000).to_i
76
+ when 'ns' then (t * 1_000_000_000).to_i
77
+ when 'm' then (t / 60).to_i
78
+ when 'h' then (t / 60 / 60).to_i
76
79
  end
77
80
  end
78
81
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-influxdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Vassilevsky
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-03 00:00:00.000000000 Z
11
+ date: 2019-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: influxdb