sidekiq_publisher 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: 8ac8cc8fb68efb773bb1baebec5fea4c5f508a87b1508a7ebb67c7d2e4655abe
4
- data.tar.gz: f18b4c67f4a16a50cbcc6ebac2539740d1edc5fc4669cdb46ec2d9f8594ae1c7
3
+ metadata.gz: 2d0e204e94d55d70449491aec30c2ba89869bc25e104a2c465f97473f9f0ee04
4
+ data.tar.gz: 431f718cfdfe74826a1846f23aa95ff20117e3a93da533144577bbff31453df6
5
5
  SHA512:
6
- metadata.gz: '081e638e7ea4800902cef72881070fde7ea543e0d4fb9f9af6a1880ffd188902c731a75e6e2588ccbaf8c9c1fc82386c3911d280dbb7ea680a6a4f855a4ab349'
7
- data.tar.gz: 5c25ec191363f939db8c271b6754922b07fe9b9ec0c17d399ea895433f5e4fd9603709deacd4509f0b2591d5e50b2eec88f61d7fa9ca8a001b8b57dbc62154b6
6
+ metadata.gz: 87aaa1c1591cbc35def8dcfb5b06f7314ffd2defd7b1368fda514dada0399d9bedb19c8d5816a67e416e5ce4528cddcce10d689ca3fc26ff6cae564b5f934a95
7
+ data.tar.gz: 4f4215086a55070cc5ce188619b2f0e2fc236fb3e9c7a831b24f65b8c0512b0f3716e0e119372a106cae28e07dba896719658c8f52f50d446d62b1a568767b9f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # sidekiq_publisher
2
2
 
3
+ ## v1.2.0
4
+ - Add `ReportUnpublishedCount` to record a metric for the number
5
+ of unpublished jobs.
6
+
3
7
  ## v1.1.0
4
8
  - Expand sidekiq support to v5.0.x-v5.2.x.
5
9
 
data/README.md CHANGED
@@ -52,6 +52,7 @@ respond to the following API:
52
52
 
53
53
  ```ruby
54
54
  count(metric_name, count)
55
+ gauge(metric_name, count)
55
56
  ```
56
57
 
57
58
  Metrics will be reported for:
@@ -59,6 +60,18 @@ Metrics will be reported for:
59
60
  - the number of jobs published in each batch
60
61
  - the number of jobs purged
61
62
 
63
+ #### Unpublished Jobs
64
+
65
+ There is also a module that can be used to record a metric for the number of
66
+ unpublished jobs:
67
+
68
+ ```ruby
69
+ SidekiqPublisher::ReportUnpublishedCount.call
70
+ ```
71
+
72
+ It is recommended to call this method periodically using something like
73
+ cron or [clockwork](https://github.com/Rykian/clockwork).
74
+
62
75
  ## Usage
63
76
 
64
77
  ### ActiveJob Adapter
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SidekiqPublisher
4
+ module ReportUnpublishedCount
5
+ def self.call
6
+ SidekiqPublisher.metrics_reporter.
7
+ gauge("sidekiq_publisher.unpublished_count",
8
+ SidekiqPublisher::Job.unpublished.count)
9
+ end
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SidekiqPublisher
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "private_attr"
4
4
  require "sidekiq_publisher/version"
5
+ require "sidekiq_publisher/report_unpublished_count"
5
6
  require "sidekiq_publisher/job"
6
7
  require "sidekiq_publisher/worker"
7
8
  require "sidekiq_publisher/publisher"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_publisher
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
  - ezCater, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-16 00:00:00.000000000 Z
11
+ date: 2019-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -300,6 +300,7 @@ files:
300
300
  - lib/sidekiq_publisher/job.rb
301
301
  - lib/sidekiq_publisher/publisher.rb
302
302
  - lib/sidekiq_publisher/railtie.rb
303
+ - lib/sidekiq_publisher/report_unpublished_count.rb
303
304
  - lib/sidekiq_publisher/runner.rb
304
305
  - lib/sidekiq_publisher/tasks.rake
305
306
  - lib/sidekiq_publisher/version.rb