founders_toolkit 0.2.1 → 0.3.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: '0045843eca13f85773f4d0fca27f2b3cb1bbe459a5076f3fdf3cc63cb5c36527'
4
- data.tar.gz: 71652d858715cd22ac97a797a2cbebcf2d2166834260cab568153986a79082e5
3
+ metadata.gz: 3949030c0d0ccd14d3f91cf6f51f38df50fee9ba6b3480ea9fbf792fd48e02cf
4
+ data.tar.gz: b776d008c899fb9f1b0ec80279dd038465130c59ba84f306f57c922d0faeb1d7
5
5
  SHA512:
6
- metadata.gz: ce28ceea9df56fb1340eaba37bca06ac8b2dbb604f14832f65df2b8b49c7e68634ffa0776e24e3d38055233f0224f16700d3e81bdd43764c0fbc03e747181e2d
7
- data.tar.gz: 137cdb98140961052d81f0ab4a1182f360ee2ca6bda200819b472330f8c017c7032bbf3f0b4e7e26c0cb31ffa7d6adef2750b18ccfb71d1762ce6d6116b7a6e6
6
+ metadata.gz: 63c67c68c2bddcb332aee24196afecfa40ae50fdf2fb849db7a65586426a4c5fa8fdc370035f6292a130a996832854d048f48372ff8b7c0bfe20113f4bd87621
7
+ data.tar.gz: 3988e5238de63d396e0ea3ebf04a8b6c27fcb8a509742c2778a114546b2bebd608bd6555beda22191d35529809b6bcd3e16eb951c35c9f58c35ab29461c370be
data/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.0] - 2021-03-29
10
+ - Added TrackedJob for simple statsd active job monitoring
11
+
9
12
  ## [0.2.1] - 2021-03-25
10
13
  ### Fixed
11
14
  - Fixed the protected attributes validator when updating the password.
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- founders_toolkit (0.2.0)
4
+ founders_toolkit (0.3.0)
5
5
  activemodel (~> 6.1)
6
6
  activesupport (~> 6.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.1.3)
12
- activesupport (= 6.1.3)
13
- activesupport (6.1.3)
11
+ activemodel (6.1.3.1)
12
+ activesupport (= 6.1.3.1)
13
+ activesupport (6.1.3.1)
14
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
15
  i18n (>= 1.6, < 2)
16
16
  minitest (>= 5.1)
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FoundersToolkit::Jobs
4
+ module TrackedJob
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ include FoundersToolkit::Monitoring::Statsdable
9
+
10
+ around_perform :update_stats
11
+ end
12
+
13
+ private
14
+
15
+ def update_stats(&block)
16
+ statsd.increment("active_job.#{self.class.queue_name}.#{self.class.name}.started")
17
+ statsd.time("active_job.#{self.class.queue_name}.#{self.class.name}", &block)
18
+ statsd.increment("active_job.#{self.class.queue_name}.#{self.class.name}.finished")
19
+ update_queue_size_stats
20
+ end
21
+
22
+ def update_queue_size_stats
23
+ Resque.queues.each do |name|
24
+ statsd.gauge("active_job.queue_size.#{name}", Resque.size(name))
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FoundersToolkit
4
- VERSION = '0.2.1'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: founders_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trae Robrock
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-03-25 00:00:00.000000000 Z
12
+ date: 2021-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -76,6 +76,7 @@ files:
76
76
  - lib/founders_toolkit/auth/securable/validations/protected_validator.rb
77
77
  - lib/founders_toolkit/engine.rb
78
78
  - lib/founders_toolkit/jobs/locked_job.rb
79
+ - lib/founders_toolkit/jobs/tracked_job.rb
79
80
  - lib/founders_toolkit/monitoring/statsdable.rb
80
81
  - lib/founders_toolkit/util.rb
81
82
  - lib/founders_toolkit/util/cacheable.rb