query_track 0.0.9 → 0.0.10

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: 3721d96e0c635e1633e6da2f049188b125b96310c5af307abfa432755986f2da
4
- data.tar.gz: 8096cc6850c1b5e4fa8bf54b4714616fb6f8433ac7ebcec95f166fddf6e5313c
3
+ metadata.gz: 9a04e764f76a05fd9b2d460c5bfc80e914cc93106f82baf2fc17ea7127d3de54
4
+ data.tar.gz: 503f4c69a63a6560aa9fef9c4fc6b83cea121c096f214b5673104c7ddcdae632
5
5
  SHA512:
6
- metadata.gz: e454a83da93cdbbd55c183c2a4d68927e6016e8c6b48638f872348d22c1974b4368323d4b5aa1d4fe25b867ccb7d223cb0f542d88fc2abbc2b4249f32452f820
7
- data.tar.gz: a330eddd0467e492f6b39c6232ed1132f43a3d5e01e2bca3746dddeddac4da911946f811e51b6bbf8fb18b0eefa157e3a755fc3ba521bb3f51f00e475c99d3cb
6
+ metadata.gz: c7d581c2148d9d9ba0158e619ab8ee4da9e8dcbf97168d1a8e59b938d747f34ec858210213f42b92efe32763d4859599557529b4b5dabaf1d96ce9956216824e
7
+ data.tar.gz: ada85f10a3991b8c291285510f5eb0838eff0ee290284111af88004b8f293a5b1adadfd3f9eee1272e1d316293d1268ddb23c63808818ab100ef696bcb494c6e
@@ -0,0 +1,20 @@
1
+ name: Ruby
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby 2.6
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.x
16
+ - name: Build and test with Rake
17
+ run: |
18
+ gem install bundler
19
+ bundle install --jobs 4 --retry 3
20
+ bundle exec rake
@@ -1,3 +1,11 @@
1
+ # v0.0.10 2020-08-07
2
+
3
+ Added custom app directory ([evanboho](https://github.com/kirillshevch/query_track/pull/60))
4
+
5
+ # v0.0.9 2019-12-21
6
+
7
+ Added custom handles ([kirillshevch](https://github.com/kirillshevch/query_track/pull/29))
8
+
1
9
  # v0.0.8 2019-08-17
2
10
 
3
11
  Added enabled/disable config ([kirillshevch](https://github.com/kirillshevch/query_track/pull/13))
@@ -9,30 +9,33 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.0.2.1)
12
+ activesupport (6.0.3.2)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
- zeitwerk (~> 2.2)
18
- ast (2.4.0)
19
- byebug (11.0.1)
20
- concurrent-ruby (1.1.5)
17
+ zeitwerk (~> 2.2, >= 2.2.2)
18
+ ast (2.4.1)
19
+ byebug (11.1.3)
20
+ concurrent-ruby (1.1.6)
21
21
  diff-lcs (1.3)
22
- dry-configurable (0.9.0)
22
+ dry-configurable (0.11.6)
23
23
  concurrent-ruby (~> 1.0)
24
24
  dry-core (~> 0.4, >= 0.4.7)
25
+ dry-equalizer (~> 0.2)
25
26
  dry-core (0.4.9)
26
27
  concurrent-ruby (~> 1.0)
27
- i18n (1.7.0)
28
+ dry-equalizer (0.3.0)
29
+ i18n (1.8.3)
28
30
  concurrent-ruby (~> 1.0)
29
- jaro_winkler (1.5.3)
30
- minitest (5.13.0)
31
- parallel (1.18.0)
32
- parser (2.6.5.0)
33
- ast (~> 2.4.0)
31
+ minitest (5.14.1)
32
+ parallel (1.19.2)
33
+ parser (2.7.1.4)
34
+ ast (~> 2.4.1)
34
35
  rainbow (3.0.0)
35
36
  rake (13.0.1)
37
+ regexp_parser (1.7.1)
38
+ rexml (3.2.4)
36
39
  rspec (3.9.0)
37
40
  rspec-core (~> 3.9.0)
38
41
  rspec-expectations (~> 3.9.0)
@@ -46,20 +49,24 @@ GEM
46
49
  diff-lcs (>= 1.2.0, < 2.0)
47
50
  rspec-support (~> 3.9.0)
48
51
  rspec-support (3.9.0)
49
- rubocop (0.75.1)
50
- jaro_winkler (~> 1.5.1)
52
+ rubocop (0.87.1)
51
53
  parallel (~> 1.10)
52
- parser (>= 2.6)
54
+ parser (>= 2.7.1.1)
53
55
  rainbow (>= 2.2.2, < 4.0)
56
+ regexp_parser (>= 1.7)
57
+ rexml
58
+ rubocop-ast (>= 0.1.0, < 1.0)
54
59
  ruby-progressbar (~> 1.7)
55
- unicode-display_width (>= 1.4.0, < 1.7)
60
+ unicode-display_width (>= 1.4.0, < 2.0)
61
+ rubocop-ast (0.1.0)
62
+ parser (>= 2.7.0.1)
56
63
  ruby-progressbar (1.10.1)
57
64
  slack_hook (0.1.2)
58
65
  thread_safe (0.3.6)
59
- tzinfo (1.2.5)
66
+ tzinfo (1.2.7)
60
67
  thread_safe (~> 0.1)
61
- unicode-display_width (1.6.0)
62
- zeitwerk (2.2.2)
68
+ unicode-display_width (1.7.0)
69
+ zeitwerk (2.3.0)
63
70
 
64
71
  PLATFORMS
65
72
  ruby
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # QueryTrack
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/query_track.svg)](https://badge.fury.io/rb/query_track)
4
- [![CircleCI](https://circleci.com/gh/kirillshevch/query_track.svg?style=svg)](https://circleci.com/gh/kirillshevch/query_track)
5
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/15b0a6c0a1838b216db8/maintainability)](https://codeclimate.com/github/kirillshevch/query_track/maintainability)
6
5
 
7
6
  Tool for finding time-consuming database queries for ActiveRecord-based Rails Apps. Provides Slack notifications with backtrace, raw SQL, time duration, etc.
@@ -41,7 +40,7 @@ end
41
40
 
42
41
  ### Filters
43
42
 
44
- To avoid noisy warnings from used gems, and places where fat queries are justified, you can filters SQL by backtrace.
43
+ To avoid noisy warnings from used gems, and places where fat queries are justified, you can filters SQL by backtrace.
45
44
  For example, you have installed `activeadmin` and want to skip everything from `app/admin`:
46
45
 
47
46
  ```ruby
@@ -50,10 +49,22 @@ QueryTrack::Settings.configure do |config|
50
49
  config.filters = ['app/admin']
51
50
  end
52
51
  ```
52
+ ### App Directory
53
+
54
+ QueryTrack finds the trace by filtering the caller by the app directory.
55
+ By default, the app directory is set to 'app', the default for Rails apps.
56
+ For apps that have a non-stanard app directory, this can be set with the `app_dir` config field:
57
+
58
+ ```ruby
59
+ QueryTrack::Settings.configure do |config|
60
+ config.duration = 0.5
61
+ config.app_dir = 'backend'
62
+ end
63
+ ```
53
64
 
54
65
  ### Enable/Disable toggle
55
66
 
56
- Enable/disable with ENV variables to turn it on/off without code push. By default *QueryTrack* is enabled.
67
+ Enable/disable with ENV variables to turn it on/off without code push. By default *QueryTrack* is enabled.
57
68
 
58
69
  ```ruby
59
70
  QueryTrack::Settings.configure do |config|
@@ -1,7 +1,7 @@
1
1
  module QueryTrack
2
2
  module Notifications
3
3
  class Log
4
- attr_reader :code, :duration, :webhook_url
4
+ attr_reader :code, :duration
5
5
 
6
6
  def initialize(code, duration)
7
7
  @code = code.strip
@@ -14,5 +14,7 @@ module QueryTrack
14
14
  setting :filters, []
15
15
 
16
16
  setting :enabled, true
17
+
18
+ setting :app_dir, 'app'
17
19
  end
18
20
  end
@@ -7,7 +7,7 @@ module QueryTrack
7
7
  end
8
8
 
9
9
  def call
10
- full_trace.select { |v| v =~ %r{app/} }[0]
10
+ full_trace.select { |v| v =~ %r{#{QueryTrack::Settings.config.app_dir}/} }[0]
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module QueryTrack
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_track
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Shevchenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-21 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -129,7 +129,7 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
- - ".circleci/config.yml"
132
+ - ".github/workflows/ruby.yml"
133
133
  - ".gitignore"
134
134
  - ".rspec"
135
135
  - ".rubocop.yml"
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.0.3
176
+ rubygems_version: 3.0.6
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Finding time-consuming database queries for ActiveRecord-based Rails Apps
@@ -1,25 +0,0 @@
1
- version: 2
2
- jobs:
3
- build:
4
- docker:
5
- - image: circleci/ruby:2.5-node
6
-
7
- steps:
8
- - checkout
9
-
10
- - restore_cache:
11
- keys:
12
- - query-track-bundle-v2-{{ checksum "query_track.gemspec" }}
13
-
14
- - run:
15
- name: Bundle Install
16
- command: bundle check || bundle install
17
-
18
- - save_cache:
19
- key: query-track-bundle-v2-{{ checksum "query_track.gemspec" }}
20
- paths:
21
- - vendor/bundle
22
-
23
- - run:
24
- name: Run Rspec
25
- command: bundle exec rspec