sidekiq-influxdb 0.1.1 → 0.2.0

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: 5ce37edba140c08a06dc47b60acd44fe998c8f43
4
- data.tar.gz: 6cd5246916f45b995e5f706ec09af1801fa27193
3
+ metadata.gz: '09d27aff93aeaa7b4f626212b4b21b17da85f2b7'
4
+ data.tar.gz: 845b0f36887af298ee04f0ba69edfe94017f7a67
5
5
  SHA512:
6
- metadata.gz: 5bc2689940af34e035a102a974f0e02858f850bad66bf24b4cb9cb406d72b5625b16d648bda78b76b43d2ed87b852089e9550e459f2734c7792f1af9fa10ee7b
7
- data.tar.gz: 897206c07583800d8241ac867f8dee6c8163ff7db22b94b6eb2986eeb878e3c1ed61a6c6ee7aa442e45f7bc87d0816fc56e5dc93ce54bafed91ef20945121824
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 # optional, default 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
- _The following timings are calculated by this gem (in seconds):_
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'
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module InfluxDB
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
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.1.1
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: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: influxdb