deprecation_collector 0.0.3 → 0.0.4

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: 3585f079427d12b48286360dc9108a232190ca81d8ec71dd055c1306d34a226e
4
- data.tar.gz: 02b556fb5ea800728f7bef7f4080da8d66bcc4d97e9a19ce1c034c88e7ec01cd
3
+ metadata.gz: 2342f445e6c89ba4ea74094dd39894d99ad6e546781405fe43a6ecba71396264
4
+ data.tar.gz: d5d6edaa942f57a726f9336a06541dabc3eadae2731d01953443a88d84fc7c2e
5
5
  SHA512:
6
- metadata.gz: 7240097b63afda5a65d127cbacc0547b76073f1a4861809c9c810fd191fca6f6d9d34bc865048bf062f2e9fc677ce8eae891b894f2c346e74dad49a2e83a9b3d
7
- data.tar.gz: 7c6726e7d03cb2aef91c28f73184ac06e6ef57ccb0ab7a5dcf83b3d3780e924fd1cae231437e402cee3e490420d913f4409e420760e709a633a5c137e3038691
6
+ metadata.gz: 9ac2e881d1687dc3756904840f21f98cc62dc497cac31804fcfeac8e4e01c780b5370497ed52da2d1ec22ca14a68ee3be4dc163c5d48cd47c38b775ef0df7b1c
7
+ data.tar.gz: 5725ea9137d79a83ea8d1df1ae9b458fe0f94479d5e7c9643ac15368ef853f75fac38cce3b7e8543fd4d03df884fa3999019d08902ba437a196f6b5b3c78dd06
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
- == unreleased
1
+ == 0.0.4
2
+ - added first_timestamp to deprecations (unix timestamp of first occurrence, not accurate because a worker with later timestamp may dump its deprecations earlier)
2
3
 
4
+ == 0.0.3
5
+ - Fixed selective deprecation cleanup (`DeprecationCollector.instance.cleanup { |d| d[:message].include?('foo') }`)
3
6
 
4
7
  == 0.0.2
5
8
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deprecation_collector (0.0.3)
4
+ deprecation_collector (0.0.4)
5
5
  redis (>= 2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/deprecation_collector.svg)](https://badge.fury.io/rb/deprecation_collector)
3
3
 
4
4
  Collects ruby and rails deprecation warnings.
5
+ Designed to be suitable for use in production under load.
6
+
5
7
  (gem is a work-in-process, documentation will come later)
6
8
 
7
9
  ## Installation
@@ -41,7 +43,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
41
43
 
42
44
  ## Contributing
43
45
 
44
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/deprecation_collector.
46
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Vasfed/deprecation_collector.
45
47
 
46
48
  ## License
47
49
 
@@ -3,7 +3,7 @@
3
3
  class DeprecationCollector
4
4
  # :nodoc:
5
5
  class Deprecation
6
- attr_reader :message, :realm, :gem_traceline, :app_traceline, :occurences, :full_backtrace
6
+ attr_reader :message, :realm, :gem_traceline, :app_traceline, :occurences, :first_timestamp, :full_backtrace
7
7
 
8
8
  CLEANUP_REGEXES = {
9
9
  # rails views generated methods names are unique per-worker
@@ -20,6 +20,7 @@ class DeprecationCollector
20
20
  @occurences = 0
21
21
  @gem_traceline = find_gem_traceline(backtrace)
22
22
  @app_traceline = find_app_traceline(backtrace)
23
+ @first_timestamp = Time.now.to_i
23
24
 
24
25
  cleanup_prefixes.each do |path|
25
26
  @gem_traceline.delete_prefix!(path)
@@ -68,6 +69,7 @@ class DeprecationCollector
68
69
  hostname: Socket.gethostname,
69
70
  revision: DeprecationCollector.instance.app_revision,
70
71
  count: @occurences, # output anyway for frequency estimation (during write_interval inside single process)
72
+ first_timestamp: first_timestamp, # this may not be accurate, a worker with later timestamp may dump earlier
71
73
  digest_base: digest_base # for debug purposes
72
74
  }.compact
73
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class DeprecationCollector
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprecation_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-15 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis