sidekiq-influxdb 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/lib/sidekiq/influxdb/server_middleware.rb +4 -2
- data/lib/sidekiq/influxdb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09d27aff93aeaa7b4f626212b4b21b17da85f2b7'
|
4
|
+
data.tar.gz: 845b0f36887af298ee04f0ba69edfe94017f7a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5fe9a307e7c41dfc7e445bd46bb77ad63b4f2241954554af8395c20718262d47dbf41ea53ff0c0df93fc121775754b8b3fb1f318238b540ece389b5f8288f5b
|
7
|
+
data.tar.gz: dded4ac420742d5168d07c1b844a748c1980820c9a135d47afcc784b5196d44331c014be3b36dc67a6bb718ad67b8c77294c4a50ecfcd467b0019b35a73674c8
|
data/README.md
CHANGED
@@ -30,7 +30,8 @@ Sidekiq.configure_server do |config|
|
|
30
30
|
chain.add Sidekiq::InfluxDB::ServerMiddleware,
|
31
31
|
influxdb_client: InfluxDB::Client.new(options), # REQUIRED
|
32
32
|
series_name: 'sidekiq_jobs', # optional, default shown
|
33
|
-
retention_policy: nil
|
33
|
+
retention_policy: nil, # optional, default nil
|
34
|
+
start_events: true # optional, default true
|
34
35
|
end
|
35
36
|
end
|
36
37
|
```
|
@@ -51,7 +52,7 @@ Tags (repetitive, indexed data — for filtering and grouping by):
|
|
51
52
|
* `time` — Standard InfluxDB timestamp. Precision of the supplied client is respected. Only `s`, `ms`, and `u` precisions are supported.
|
52
53
|
* `queue` — Queue name.
|
53
54
|
* `class` — Job class name.
|
54
|
-
* `event` — What happened to the job at the specified `time`: `start`, `finish`, or `error`.
|
55
|
+
* `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.
|
55
56
|
* `error` — If `event=error`, this tag contains the exception class name.
|
56
57
|
|
57
58
|
Values (unique, non-indexed data — for aggregation):
|
@@ -59,7 +60,7 @@ Values (unique, non-indexed data — for aggregation):
|
|
59
60
|
* `jid` — Unique job ID.
|
60
61
|
* `creation_time` — Job creation time.
|
61
62
|
|
62
|
-
|
63
|
+
Values calculated by this gem (in seconds):
|
63
64
|
|
64
65
|
* `waited` — How long the job waited in the `queue` until Sidekiq got around to starting it.
|
65
66
|
* `worked` — How long it took to perform the job from start to finish or to an exception.
|
@@ -94,3 +95,5 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/vassil
|
|
94
95
|
## Code of Conduct
|
95
96
|
|
96
97
|
Everyone interacting in the Sidekiq::InfluxDB project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/vassilevsky/sidekiq-influxdb/blob/master/CODE_OF_CONDUCT.md).
|
98
|
+
|
99
|
+
[![Sponsored by FunBox](https://funbox.ru/badges/sponsored_by_funbox.svg)](https://funbox.ru)
|
@@ -6,11 +6,13 @@ module Sidekiq
|
|
6
6
|
def initialize(
|
7
7
|
influxdb_client:,
|
8
8
|
series_name: 'sidekiq_jobs',
|
9
|
-
retention_policy: nil
|
9
|
+
retention_policy: nil,
|
10
|
+
start_events: true
|
10
11
|
)
|
11
12
|
@influxdb = influxdb_client
|
12
13
|
@series = series_name
|
13
14
|
@retention = retention_policy
|
15
|
+
@start_events = start_events
|
14
16
|
end
|
15
17
|
|
16
18
|
def call(worker, msg, queue)
|
@@ -28,7 +30,7 @@ module Sidekiq
|
|
28
30
|
},
|
29
31
|
timestamp: in_correct_precision(t)
|
30
32
|
}
|
31
|
-
save(data)
|
33
|
+
save(data) if @start_events
|
32
34
|
begin
|
33
35
|
yield
|
34
36
|
data[:tags][:event] = 'finish'
|
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: 0.
|
4
|
+
version: 0.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:
|
11
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: influxdb
|