sidekiq-job_alert 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: 24d426ea655d05860eba309663015e79987467c5
4
- data.tar.gz: 285206f4f6bec4487fde802ee9ee989136ee0419
3
+ metadata.gz: 1ebae05bf920c412d640839f133b0fa028caf5c3
4
+ data.tar.gz: d817838aa611f5a8a831ed81e1607152bf49ff2f
5
5
  SHA512:
6
- metadata.gz: 92d9f067dc27fa1bfa76c32bfc0691b805daadfc92b66b9b6663022ef746f6e0e15a16d03a27162a94d190253292aa4973d3f55d2553c26e5572c18fc79aa716
7
- data.tar.gz: eb9c516eb642846a44cb2349abe48c7da3c77f91d0c308327aeec1b671c44bd980942901044ba336cfebb5bff1cdba1ac8c01085e758e2272b3d493918d038a0
6
+ metadata.gz: 8812b0957d32f160b5cfdecd37590ad6a24bd61f5a0b46d1b5d9c9e94c64f793672ebe28c61a56a07e8c7ba5ceaedd5ac6810da58bb2330ccda3a33db346fbc8
7
+ data.tar.gz: 909758252d9e43e6a901145802036aad38f2c594a3293e2850155a8e96b55944bac2df7d5690c0f7df2fd7fa2c78900fc6f5319b80fd5c90d22e0c3114bf878f
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
 
13
13
  .idea
14
+ slack_example.yml
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sidekiq-job_alert (0.1.4)
4
+ sidekiq-job_alert (0.1.5)
5
5
  sidekiq (~> 4.2.1)
6
6
  slack-notifier (~> 2.3.2)
7
7
  thor
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Sidekiq::JobAlert
2
2
 
3
- Sidekiq-job_alert is a gem to send alert to slack to warn you when there are too many waiting jobs or dead jobs
3
+ Sidekiq-job_alert is a gem to send alert to slack to warn you when there are too many waiting jobs or dead jobs
4
4
 
5
5
  ## Installation
6
6
 
@@ -19,41 +19,37 @@ Or install it yourself as:
19
19
  $ gem install sidekiq-job_alert
20
20
 
21
21
  ## Usage
22
- - copy `sidekiq_job_alert.yml` to your local and config it
22
+ - config
23
+ - copy `sidekiq_job_alert.yml` to your local and edit it to fit your needs
24
+ - example:
23
25
 
24
26
  ```yaml
25
- :webhook_url: "YOUR SLACK INCOMING WEBHOOK"
26
- :username: "Sidekiq_JobAlert"
27
- :channel: "YOUR CHANNEL"
27
+ :webhook_url: "https://hooks.slack.com/services/xxxx"
28
+ :username: "Sidekiq_Job_Alert"
29
+ :channel: "sidekiq-job"
28
30
  :link_names: 'false'
29
- :sidekiq_url: "http://localhost:3000/sidekiq/" # Replace with your sidekiq url
31
+ :sidekiq_url: "http://localhost:3000/sidekiq/"
30
32
  :alert_dead_jobs:
31
33
  :message: "%<job_counter>d dead jobs.\n"
32
34
  :alert_total_waiting_jobs:
33
35
  :message: "Totally %<job_counter>d waiting jobs.\n"
34
36
  :all:
35
- :limit: 0 # Only send alert when total waiting jobs over limit
37
+ :limit: 50
36
38
  :alert_each_waiting_job:
37
39
  :message: "%<job_counter>d waiting jobs in %<queue_name>s.\n"
38
- :queue_1:
39
- :limit: 0 # Only send alert when queue_1's jobs over limit
40
- :queue_2:
41
- :limit: 0 # Only send alert when queue_2's jobs over limit
40
+ :create_place:
41
+ :limit: 10
42
+ :update_place:
43
+ :limit: 10
42
44
  ```
43
45
 
44
46
  - run
47
+ - command line tool
48
+ - `sidekiq_job_alert alert --config ./sidekiq_job_alert.yml`
49
+ - rails application
50
+ - ` Sidekiq::JobAlert::Notifier.new('config/sidekiq_job_alert.yml').call `
51
+ - notification
45
52
 
46
- ```ruby
47
- sidekiq_job_alert alert --config ./sidekiq_job_alert.yml
48
- ```
49
-
50
- or
51
-
52
- ```ruby
53
- Sidekiq::JobAlert::Notifier.new('config/sidekiq_job_alert.yml').call
54
- ```
55
-
56
- ## Example
57
53
  ![image](https://user-images.githubusercontent.com/853200/65889183-c2612480-e3db-11e9-9c9c-cdae69ef2863.png)
58
54
 
59
55
  ## Development
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module JobAlert
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  :webhook_url: "YOUR SLACK INCOMING WEBHOOK"
2
- :username: "Sidekiq_JobAlert"
3
- :channel: "YOUR CHANNEL"
2
+ :username: "Sidekiq_Job_Alert"
3
+ :channel: "YOUR CHANNEL NAME"
4
4
  :link_names: 'false'
5
5
  :sidekiq_url: "http://localhost:3000/sidekiq/" # Replace with your sidekiq url
6
6
  :alert_dead_jobs:
@@ -8,11 +8,10 @@
8
8
  :alert_total_waiting_jobs:
9
9
  :message: "Totally %<job_counter>d waiting jobs.\n"
10
10
  :all:
11
- :limit: 0 # Only send alert when total waiting jobs over limit
11
+ :limit: 50 # Send alert when total waiting jobs over 50
12
12
  :alert_each_waiting_job:
13
13
  :message: "%<job_counter>d waiting jobs in %<queue_name>s.\n"
14
- :queue_1:
15
- :limit: 0 # Only send alert when queue_1's jobs over limit
16
- :queue_2:
17
- :limit: 0 # Only send alert when queue_2's jobs over limit
18
-
14
+ :queue_1: # Replace `queue_1` with our own sidekiq queue name
15
+ :limit: 10 # Send alert when queue_1's jobs is over 10
16
+ :queue_2: # Replace `queue_2` with our own sidekiq queue name
17
+ :limit: 10 # Send alert when queue_2's jobs is over 10
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-job_alert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - feng.zhang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-30 00:00:00.000000000 Z
11
+ date: 2019-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler