activeinsights 0.1.0 → 0.1.2

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: e4eaa4679af5bdd26c11fee43867a9fb1dd49604962280c7adf7542a55e996ff
4
- data.tar.gz: 8cf132a8cb971a91c0f3bac654de0cfc43e6ee6a0d3e858a5ef09bffcf3fdd01
3
+ metadata.gz: b7cd811a762ab51064d53274437f64f93f74779801c01ca7862994d5680fc236
4
+ data.tar.gz: 289bdbf78cfaa3497dd2943752ca074fce616171020828a1ac519cac4cb647b8
5
5
  SHA512:
6
- metadata.gz: 70cad20e56ce23648fae3e31e35846fdaa936e90326e81767ab80a65363b3e5a63ca4d39db2496584ba9318c7e6f836e368f2551baf8dec5bbb28194e668c3fc
7
- data.tar.gz: 940ee1ff0796fea342a072aadd51e1f81224e6c1f26cbd4f392fa5552630cb78b07c82bad331d729f3b2dd5e02e3f77f206bf674f0684dc2a2b576012b8a6b10
6
+ metadata.gz: '052695741cc87fd2615062dd310808f7c518cbbe5019ffc20086a6c0d0776ab00d149716743dd8f642c0625c439c20bfa35e2ceb0191bf920cbb38eb25172cfb'
7
+ data.tar.gz: e0635d4cef4b87156b71c3e7fe30ef1520b11df3787ba2e04acb8150d955492edb5eddb2cdaca90da7c637f3c0f14f10aa41809792e336ab64d16bcbd77d59f9
@@ -19,7 +19,7 @@ module ActiveInsights
19
19
  @minutes ||=
20
20
  ActiveInsights::Request.where(started_at: @date).
21
21
  where(formatted_controller: params[:formatted_controller]).
22
- group_by_minute.with_durations.select_started_at
22
+ minute_by_minute.with_durations.select_started_at
23
23
  end
24
24
  end
25
25
  end
@@ -17,7 +17,7 @@ module ActiveInsights
17
17
  def minutes
18
18
  @minutes ||=
19
19
  ActiveInsights::Request.where(started_at: @date).
20
- group_by_minute.with_durations.select_started_at
20
+ minute_by_minute.with_durations.select_started_at
21
21
  end
22
22
  end
23
23
  end
@@ -5,7 +5,7 @@ module ActiveInsights
5
5
  def index
6
6
  @minutes =
7
7
  ActiveInsights::Request.where(started_at: @date).
8
- group_by_minute.select("COUNT(id) AS rpm").select_started_at.
8
+ minute_by_minute.select("COUNT(id) AS rpm").select_started_at.
9
9
  map { |minute| [minute.started_at.strftime("%-l:%M%P"), minute.rpm] }
10
10
  end
11
11
 
@@ -10,7 +10,7 @@ module ActiveInsights
10
10
  select("STRING_AGG(CAST(duration AS varchar), ',') AS durations")
11
11
  end
12
12
  }
13
- scope :group_by_minute, lambda {
13
+ scope :minute_by_minute, lambda {
14
14
  case connection.adapter_name
15
15
  when "SQLite"
16
16
  group("strftime('%Y-%m-%d %H:%M:00 UTC', " \
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ActiveInsightsRequest < ActiveRecord::Migration[7.1]
4
- def change # rubocop:disable Metrics/AbcSize
4
+ def change
5
5
  create_table :active_insights_requests, if_not_exists: true do |t|
6
6
  t.string :controller
7
7
  t.string :action
@@ -20,6 +20,8 @@ module ActiveInsights
20
20
  ActiveSupport::Notifications.
21
21
  subscribe("process_action.action_controller") do |_name,
22
22
  started, finished, unique_id, payload|
23
+ next if Rails.env.development?
24
+
23
25
  Thread.new do
24
26
  ActiveRecord::Base.connection_pool.with_connection do
25
27
  ActiveInsights::Request.create!(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveInsights
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeinsights
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza