query_tracker 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +29 -5
- data/images/bar_chart.png +0 -0
- data/images/console.png +0 -0
- data/images/html.png +0 -0
- data/lib/query_tracker/version.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d45ba7b0de192f250a1c7a747fb0f7692b84e892c6814a53b1677b0b995648b
|
4
|
+
data.tar.gz: 85321b29452918c9d0c23e8f03fd7ce6eef9f00d7075259df09c826f2f090145
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22bed0698b39c950ad90d3a533a51ece4551b0f0499da2fbdbf67a4f48587c0af1af2e313311f8a07007e06f7523a317723df0b67d214e98d98022db11028a84
|
7
|
+
data.tar.gz: 0aa2e1e6550da7b6013ef2947c3ebd22c963ace0628bfac0004ac72b51cca81978267a1cdd28053a8e95879d632bb730a655fe0f01760ecacd5d51b3df24ac6c
|
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# QueryTracker
|
2
2
|
|
3
|
+
(DEPRECATED use active-record-query-count instead)
|
3
4
|
`QueryTracker` is a Ruby gem designed to help you track and analyze SQL queries executed by your ActiveRecord models. By subscribing to ActiveSupport notifications, it provides detailed insights into the queries being run, including the tables involved and the locations in your code where the queries are generated.
|
4
5
|
There are three things this gem allows you to do
|
5
6
|
|
@@ -18,18 +19,18 @@ gem 'query_tracker'
|
|
18
19
|
And then execute:
|
19
20
|
|
20
21
|
```bash
|
21
|
-
|
22
|
+
bundle install
|
22
23
|
```
|
23
24
|
|
24
25
|
Or install it yourself as:
|
25
26
|
|
26
27
|
```bash
|
27
|
-
|
28
|
+
gem install query_tracker
|
28
29
|
```
|
29
30
|
|
30
31
|
## Usage
|
31
32
|
|
32
|
-
There are
|
33
|
+
There are four ways of using this gem:
|
33
34
|
|
34
35
|
1. With a block of code
|
35
36
|
|
@@ -74,8 +75,6 @@ this will open up a graph comparing the quantity of SQL of the two codes
|
|
74
75
|
config.after_initialize do
|
75
76
|
QueryTracker.configure do |configuration|
|
76
77
|
configuration.enable_middleware = true
|
77
|
-
configuration.ignore_table_count = 1
|
78
|
-
configuration.max_locations_per_table = 4
|
79
78
|
end
|
80
79
|
end
|
81
80
|
```
|
@@ -84,6 +83,31 @@ this will open up a graph comparing the quantity of SQL of the two codes
|
|
84
83
|
|
85
84
|
There are two ways of displaying the collected queries data, `:console` and `:html`, to select one pass the printer argument to `start_with_block` o `end_recording` methods.
|
86
85
|
|
86
|
+
If you use `html` with WSL enviroment, you need to set on your enviroments variables the `WSL_DISTRIBUTION` that you are using, so the dependency Launchy work as expected.
|
87
|
+
|
88
|
+
### Configuration options
|
89
|
+
|
90
|
+
When visualizing the html table or the console output, tables with less than `ignore_table_count` will not be shown. Also, the ammount of locations to show is given by `max_locations_per_table`
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
config.after_initialize do
|
94
|
+
QueryTracker.configure do |configuration|
|
95
|
+
configuration.ignore_table_count = 1
|
96
|
+
configuration.max_locations_per_table = 4
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
```
|
101
|
+
|
102
|
+
## Examples of visualization
|
103
|
+
|
104
|
+
1. Console output
|
105
|
+
![Console output](images/console.png)
|
106
|
+
2. HTML output
|
107
|
+
![HTML output](images/html.png)
|
108
|
+
3. Bar chart output
|
109
|
+
![Bar chart output](images/bar_chart.png)
|
110
|
+
|
87
111
|
## Development
|
88
112
|
|
89
113
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests.
|
Binary file
|
data/images/console.png
ADDED
Binary file
|
data/images/html.png
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: query_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jose Lara
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -215,6 +215,9 @@ extra_rdoc_files: []
|
|
215
215
|
files:
|
216
216
|
- README.md
|
217
217
|
- bin/setup
|
218
|
+
- images/bar_chart.png
|
219
|
+
- images/console.png
|
220
|
+
- images/html.png
|
218
221
|
- lib/query_tracker.rb
|
219
222
|
- lib/query_tracker/compare/comparator.rb
|
220
223
|
- lib/query_tracker/configuration.rb
|
@@ -232,7 +235,7 @@ files:
|
|
232
235
|
- lib/query_tracker/recording/base.rb
|
233
236
|
- lib/query_tracker/recording/tracker.rb
|
234
237
|
- lib/query_tracker/version.rb
|
235
|
-
homepage: https://github.com/jvlara/
|
238
|
+
homepage: https://github.com/jvlara/active-record-query-count
|
236
239
|
licenses:
|
237
240
|
- MIT
|
238
241
|
metadata: {}
|
@@ -254,5 +257,6 @@ requirements: []
|
|
254
257
|
rubygems_version: 3.4.10
|
255
258
|
signing_key:
|
256
259
|
specification_version: 4
|
257
|
-
summary: Display an overview of
|
260
|
+
summary: "(DEPRECATED use active-record-query-count instead) Display an overview of
|
261
|
+
quantity of queries and their origin in Rails applications."
|
258
262
|
test_files: []
|