activeinsights 0.3.4 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/app/models/active_insights/record.rb +2 -2
- data/lib/active_insights/engine.rb +4 -2
- data/lib/active_insights/version.rb +1 -1
- data/lib/active_insights.rb +15 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2778801a841416fe7477c3eaabd4b6a5a77b9fda76256e7254e36d14491c9b9
|
4
|
+
data.tar.gz: adb6b90323b2d2798bd30a4a316e8b9f60216a2108d6c929e0d1e9bc8d7e8a14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79c9abe8a4f26633ad888639829209fd63a9871b5a2a00249e4cc6c94dc18b86547c8a19c212a06d2888099b6ee4eb3d0611ceebc0eb955d37d3d21794dc1f53
|
7
|
+
data.tar.gz: fa13721b3a897868c7c39d87582f044371bb8b27959b3d0264024a908c18ed611b5fb71e3b40eb78ad6031985f6514527d8730c51246d2030b4c187b7f00eaaf
|
data/README.md
CHANGED
@@ -1,17 +1,21 @@
|
|
1
1
|
# ActiveInsights
|
2
2
|
|
3
|
-
One of the fundemental tools needed
|
4
|
-
way to track response times. Unfortunately, theres no free, easy,
|
3
|
+
One of the fundemental tools needed when taking your Rails app to production is
|
4
|
+
a way to track response times. Unfortunately, theres no free, easy,
|
5
5
|
open source way to track them for small or medium apps. Skylight, Honeybadger,
|
6
|
-
Sentry,
|
6
|
+
Sentry, AppSignal, etc. are great, but they are are closed source and
|
7
7
|
there should be an easy open source alternative where you control the data.
|
8
8
|
|
9
|
-
ActiveInsights hooks into the ActiveSupport [instrumention](https://guides.rubyonrails.org/active_support_instrumentation.html#)
|
9
|
+
ActiveInsights hooks into the ActiveSupport [instrumention](https://guides.rubyonrails.org/active_support_instrumentation.html#)
|
10
|
+
baked directly into Rails. ActiveInsights tracks RPM, RPM per controller, and
|
11
|
+
p50/p95/p99 response times and charts all those by the minute. It also tracks
|
12
|
+
jobs per minute, their duration, and latency.
|
10
13
|
|
11
14
|
![screenshot 1](https://github.com/npezza93/activeinsights/blob/main/.github/screenshot1.png)
|
12
15
|
![screenshot 2](https://github.com/npezza93/activeinsights/blob/main/.github/screenshot2.png)
|
13
16
|
![screenshot 3](https://github.com/npezza93/activeinsights/blob/main/.github/screenshot3.png)
|
14
17
|
![screenshot 4](https://github.com/npezza93/activeinsights/blob/main/.github/screenshot4.png)
|
18
|
+
![screenshot 5](https://github.com/npezza93/activeinsights/blob/main/.github/screenshot5.png)
|
15
19
|
|
16
20
|
## Installation
|
17
21
|
Add this line to your application's Gemfile:
|
@@ -23,8 +23,8 @@ module ActiveInsights
|
|
23
23
|
"'#{table_name}'.'started_at')")
|
24
24
|
when "Mysql2", "Mysql2Spatial", "Mysql2Rgeo", "Trilogy"
|
25
25
|
group("CONVERT_TZ(DATE_FORMAT(#{table_name.split('.').map do |arg|
|
26
|
-
|
27
|
-
|
26
|
+
"`#{arg}`"
|
27
|
+
end.join('.')}.`started_at`" \
|
28
28
|
", '%Y-%m-%d %H:%i:00'), 'Etc/UTC', '+00:00')")
|
29
29
|
when "PostgreSQL"
|
30
30
|
group("DATE_TRUNC('minute', \"#{table_name}\"." \
|
@@ -28,6 +28,8 @@ module ActiveInsights
|
|
28
28
|
ActiveSupport::Notifications.
|
29
29
|
subscribe("perform.active_job") do |_name,
|
30
30
|
started, finished, unique_id, payload|
|
31
|
+
next unless ActiveInsights.enabled?
|
32
|
+
|
31
33
|
ActiveInsights::Job.setup(started, finished, unique_id, payload)
|
32
34
|
end
|
33
35
|
end
|
@@ -36,8 +38,8 @@ module ActiveInsights
|
|
36
38
|
ActiveSupport::Notifications.
|
37
39
|
subscribe("process_action.action_controller") do |_name,
|
38
40
|
started, finished, unique_id, payload|
|
39
|
-
next if
|
40
|
-
ActiveInsights.
|
41
|
+
next if ActiveInsights.ignored_endpoint?(payload) ||
|
42
|
+
!ActiveInsights.enabled?
|
41
43
|
|
42
44
|
Thread.new do
|
43
45
|
ActiveRecord::Base.connection_pool.with_connection do
|
data/lib/active_insights.rb
CHANGED
@@ -7,11 +7,21 @@ require "active_insights/version"
|
|
7
7
|
require "active_insights/engine"
|
8
8
|
|
9
9
|
module ActiveInsights
|
10
|
-
mattr_accessor :connects_to, :ignored_endpoints
|
10
|
+
mattr_accessor :connects_to, :ignored_endpoints, :enabled
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
class << self
|
13
|
+
def ignored_endpoint?(payload)
|
14
|
+
ignored_endpoints.to_a.include?(
|
15
|
+
"#{payload[:controller]}##{payload[:action]}"
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def enabled?
|
20
|
+
if enabled.nil?
|
21
|
+
!Rails.env.development?
|
22
|
+
else
|
23
|
+
enabled.present?
|
24
|
+
end
|
25
|
+
end
|
16
26
|
end
|
17
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeinsights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Pezza
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chartkick
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
rubygems_version: 3.5.
|
114
|
+
rubygems_version: 3.5.5
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Rails performance tracking
|