active_record_query_counter 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/continuous_integration.yml +33 -11
- data/.standard.yml +1 -1
- data/CHANGELOG.md +23 -0
- data/README.md +1 -0
- data/VERSION +1 -1
- data/active_record_query_counter.gemspec +2 -4
- data/lib/active_record_query_counter.rb +2 -2
- metadata +5 -33
- data/CHANGE_LOG.md +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29ed527d87037456aa27022d13ea436b462945329de3b343a9391da90db88f90
|
4
|
+
data.tar.gz: 22edd4498820f0452999cbffbad2532b534d791c8b41f0039599c0407bcc2279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df174f4eb9e9b882c57fdae34456c36bff95581497cafcb628b57a42d06eefe3b784d7f7454367d36cb0d39726cfc141c0d808e9a14648fea898cc84603d651f
|
7
|
+
data.tar.gz: a0ba3580554d39fe487fbc2eb5a9d1a7db59ad0d964b6f4f17e3bc2bdd642c7b46728d9e7130d015f14486901b5db224c6af4c6039d9c127c33d97fecb3a18e8
|
@@ -12,21 +12,35 @@ env:
|
|
12
12
|
BUNDLE_PATH: vendor/bundle
|
13
13
|
BUNDLE_JOBS: 3
|
14
14
|
BUNDLE_RETRY: 3
|
15
|
+
CC_TEST_REPORTER_ID: 8f360e59f6cb98313ccbb27fecf82f667455acec33cf23ae115c2db121852700
|
15
16
|
jobs:
|
16
17
|
specs:
|
17
|
-
name: ${{ matrix.job }} ruby-${{ matrix.ruby }} ${{ matrix.activerecord && format('activerecord-{0}', matrix.activerecord) }}
|
18
|
+
name: ${{ matrix.job }} ruby-${{ matrix.combo.ruby || matrix.ruby }} ${{ matrix.combo.activerecord && format('activerecord-{0}', matrix.combo.activerecord) }}
|
18
19
|
runs-on: ubuntu-latest
|
19
20
|
strategy:
|
20
21
|
fail-fast: false
|
21
22
|
matrix:
|
22
|
-
|
23
|
-
|
23
|
+
combo:
|
24
|
+
- activerecord: "latest"
|
25
|
+
ruby: "3.0"
|
26
|
+
coverage: true
|
27
|
+
- activerecord: "6.1"
|
28
|
+
ruby: "3.0"
|
29
|
+
- activerecord: "6.0"
|
30
|
+
ruby: "2.7"
|
31
|
+
- activerecord: "5.2"
|
32
|
+
ruby: "2.6"
|
33
|
+
- activerecord: "5.1"
|
34
|
+
ruby: "2.6"
|
35
|
+
- activerecord: "5.0"
|
36
|
+
ruby: "2.5"
|
24
37
|
job: [ rspec ]
|
25
38
|
include:
|
26
|
-
- ruby: "
|
27
|
-
activerecord:
|
39
|
+
- ruby: "3.0"
|
40
|
+
activerecord: "latest"
|
28
41
|
job: rspec
|
29
42
|
- ruby: "2.7"
|
43
|
+
activerecord: "latest"
|
30
44
|
job: standardrb
|
31
45
|
steps:
|
32
46
|
- name: checkout
|
@@ -34,18 +48,26 @@ jobs:
|
|
34
48
|
- name: set up Ruby
|
35
49
|
uses: ruby/setup-ruby@v1
|
36
50
|
with:
|
37
|
-
ruby-version: ${{ matrix.ruby }}
|
38
|
-
- name:
|
39
|
-
|
40
|
-
|
51
|
+
ruby-version: ${{ matrix.combo.ruby || matrix.ruby }}
|
52
|
+
- name: setup bundler
|
53
|
+
run: |
|
54
|
+
if [ "${{ matrix.combo.bundler }}" != "" ]; then
|
55
|
+
gem uninstall bundler --all
|
56
|
+
gem install bundler --no-document --version ${{ matrix.combo.bundler }}
|
57
|
+
fi
|
58
|
+
if [ "${{ matrix.combo.activerecord || matrix.activerecord }}" != "latest" ]; then
|
59
|
+
echo "using gemfile gemfiles/activerecord_${{ matrix.combo.activerecord || matrix.activerecord }}.gemfile"
|
60
|
+
bundle config set gemfile "gemfiles/activerecord_${{ matrix.combo.activerecord || matrix.activerecord }}.gemfile"
|
61
|
+
fi
|
41
62
|
bundle update
|
42
|
-
bundle exec appraisal generate
|
43
|
-
bundle config set gemfile "gemfiles/activerecord_${{ matrix.activerecord }}.gemfile"
|
44
63
|
- name: install dependencies
|
45
64
|
run: bundle install
|
46
65
|
- name: specs
|
47
66
|
if: matrix.job == 'rspec'
|
48
67
|
run: bundle exec rake spec
|
68
|
+
- name: code coverage
|
69
|
+
if: matrix.coverage == true
|
70
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
49
71
|
- name: standardrb
|
50
72
|
if: matrix.job == 'standardrb'
|
51
73
|
run: bundle exec rake standard
|
data/.standard.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## 1.1.2
|
8
|
+
### Added
|
9
|
+
* Ruby 3.0 compatibility
|
10
|
+
### Removed
|
11
|
+
* Dropped support for ActiveRecord 4.2
|
12
|
+
|
13
|
+
## 1.1.1
|
14
|
+
### Added
|
15
|
+
* Expose stack traces where transactions are being committed.
|
16
|
+
|
17
|
+
## 1.1.0
|
18
|
+
### Added
|
19
|
+
* Add number of transactions to statistics being tracked.
|
20
|
+
|
21
|
+
## 1.0.0
|
22
|
+
### Added
|
23
|
+
* Track stats about queries run by ActiveRecord within a block.
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
![Continuous Integration](https://github.com/bdurand/active_record_query_counter/workflows/Continuous%20Integration/badge.svg)
|
4
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/21094ecec0c151983bb1/maintainability)](https://codeclimate.com/github/bdurand/active_record_query_counter/maintainability)
|
5
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/21094ecec0c151983bb1/test_coverage)](https://codeclimate.com/github/bdurand/active_record_query_counter/test_coverage)
|
5
6
|
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
6
7
|
|
7
8
|
This gem injects itself into ActiveRecord to count the number of queries, the number of rows returned, the amount of time spent on queries, the number of transactions, and the amount of time spent inside transactions within a block.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
@@ -26,9 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
|
29
|
-
spec.add_dependency "activerecord", ">=
|
29
|
+
spec.add_dependency "activerecord", ">= 5.0"
|
30
30
|
|
31
|
-
spec.add_development_dependency "bundler"
|
32
|
-
spec.add_development_dependency "rspec", ["~> 3.0"]
|
33
|
-
spec.add_development_dependency "sqlite3"
|
31
|
+
spec.add_development_dependency "bundler"
|
34
32
|
end
|
@@ -132,7 +132,7 @@ module ActiveRecordQueryCounter
|
|
132
132
|
|
133
133
|
# Module to prepend to the connection adapter to inject the counting behavior.
|
134
134
|
module ConnectionAdapterExtension
|
135
|
-
def exec_query(*args)
|
135
|
+
def exec_query(*args, **kwargs)
|
136
136
|
start_time = Time.now
|
137
137
|
result = super
|
138
138
|
if result.is_a?(ActiveRecord::Result)
|
@@ -143,7 +143,7 @@ module ActiveRecordQueryCounter
|
|
143
143
|
end
|
144
144
|
|
145
145
|
module TransactionManagerExtension
|
146
|
-
def begin_transaction(*args)
|
146
|
+
def begin_transaction(*args, **kwargs)
|
147
147
|
if open_transactions == 0
|
148
148
|
@active_record_query_counter_transaction_start_time = Time.current
|
149
149
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_query_counter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,44 +16,16 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: sqlite3
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
31
|
- - ">="
|
@@ -76,7 +48,7 @@ files:
|
|
76
48
|
- ".github/dependabot.yml"
|
77
49
|
- ".github/workflows/continuous_integration.yml"
|
78
50
|
- ".standard.yml"
|
79
|
-
-
|
51
|
+
- CHANGELOG.md
|
80
52
|
- MIT_LICENSE
|
81
53
|
- README.md
|
82
54
|
- VERSION
|