notable 0.3.2 → 0.3.3

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: 97e610b1e6274a603bf4404cad75d7fb024b265b2ccad352916940e3f1b81dd1
4
- data.tar.gz: 0b7b71c06fcf86d5b9cf5b3aa10439d7902d3c9a185ce52ae50ce43a63aa8030
3
+ metadata.gz: dffa6e740a343d9d94cb914e52fa0627c33e42eaa20c9d9600365ff9fc70a4bf
4
+ data.tar.gz: 7928839098511ba32cb90106f5aa771e64886284f833da98eade40b5fa8637f5
5
5
  SHA512:
6
- metadata.gz: 24736ec76486d7f1dc515bbf7d45da6c0d4328f56b27232ace17df78f5899b9dd1230b4f11a4c62baa5ac729df2d113b595f038467d9099a0f62d5d111dabcb8
7
- data.tar.gz: a2af6018e63f62f886be2212b6349909ee3d36f15aaa16063508d0420366921afd12b8b27e914ebcc889f0af4287dad87e8fa7dd956729341a976bb1b3c2c3af
6
+ metadata.gz: 80f40eecda17a03ad548ac6faa75b049b83c3e57121a65418dbc0bc2508ad1a0c04424cfe551feb2283d0e366c44968732cd9e00d5df01faa23d1c02f663946f
7
+ data.tar.gz: 1a931594bca9c6c5907592542c40e1f87b3f92731086403c04ca7e486dcf7390a46a4d886b44cd00e9a0b19fed1f6882dbd5de6b7736ad9a7d34c8f11b5c699a
@@ -1,3 +1,7 @@
1
+ ## 0.3.3 (2020-07-26)
2
+
3
+ - Added support for `queued_time` for Active Job 6
4
+
1
5
  ## 0.3.2 (2020-07-24)
2
6
 
3
7
  - Added support for Rails API
data/README.md CHANGED
@@ -1,12 +1,8 @@
1
1
  # Notable
2
2
 
3
- :star2: Extraordinary insight into your users and background jobs
3
+ :star2: :star2: :star2:
4
4
 
5
- Wouldn’t it be great to see when one of your users encounters an error, timeout, or validation failure? Now you can - directly in your admin pages.
6
-
7
- #### Introducing Notable
8
-
9
- Notable tracks notable requests and background jobs and stores them in your database. What makes a request or job notable? There are a number of default situations, but ultimately you decide what interests you.
5
+ Notable tracks notable requests and background jobs and stores them in your database. What makes a request or job notable? There are a number of default situations, but ultimately you decide what interests you.
10
6
 
11
7
  By default, Notable tracks:
12
8
 
@@ -43,26 +39,18 @@ rails db:migrate
43
39
 
44
40
  To explore the data, check out [Blazer](https://github.com/ankane/blazer).
45
41
 
46
- ## Requests
42
+ ## How It Works
47
43
 
48
44
  A `Notable::Request` is created for:
49
45
 
50
46
  - errors
51
47
  - 404s
52
48
  - slow requests
53
- - timeouts
49
+ - timeouts from [Slowpoke](https://github.com/ankane/slowpoke)
54
50
  - validation failures
55
51
  - [CSRF failures](https://guides.rubyonrails.org/security.html#cross-site-request-forgery-csrf)
56
52
  - unpermitted parameters
57
- - blocked and throttled requests
58
-
59
- For timeouts, use [Slowpoke](https://github.com/ankane/slowpoke).
60
-
61
- For blocked and throttled requests, use [Rack Attack](https://github.com/kickstarter/rack-attack).
62
-
63
- ## Jobs
64
-
65
- Wouldn’t it be great to have a record of exact jobs that fail?
53
+ - blocked and throttled requests from [Rack Attack](https://github.com/kickstarter/rack-attack)
66
54
 
67
55
  A `Notable::Job` is created for:
68
56
 
@@ -70,19 +58,13 @@ A `Notable::Job` is created for:
70
58
  - slow jobs
71
59
  - validation failures
72
60
 
73
- ## Manual Tracking
74
-
75
- ```ruby
76
- Notable.track(note_type, note)
77
- ```
78
-
79
- Like
61
+ Create a custom note inside a request or job with:
80
62
 
81
63
  ```ruby
82
- Notable.track("Auth Event", "Signed In")
64
+ Notable.track("Note Type", "Optional extra info")
83
65
  ```
84
66
 
85
- ## Customize
67
+ ## Customization
86
68
 
87
69
  Disable tracking in certain environments
88
70
 
@@ -70,6 +70,7 @@ module Notable
70
70
  exception = nil
71
71
  notes = nil
72
72
  start_time = Time.now
73
+ created_at = Time.parse(created_at) if created_at.is_a?(String)
73
74
  queued_time = created_at ? start_time - created_at : nil
74
75
  begin
75
76
  yield
@@ -4,8 +4,8 @@ module Notable
4
4
 
5
5
  included do
6
6
  around_perform do |job, block|
7
- # no way to get queued_at time :(
8
- Notable.track_job(job.class.name, job.job_id, job.queue_name, nil, try(:notable_slow_job_threshold)) do
7
+ # enqueued_at is only available in Active Job 6+
8
+ Notable.track_job(job.class.name, job.job_id, job.queue_name, job.try(:enqueued_at), try(:notable_slow_job_threshold)) do
9
9
  block.call
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Notable
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-24 00:00:00.000000000 Z
11
+ date: 2020-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport