rails-pg-extras 3.2.3 → 3.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +2 -0
- data/README.md +32 -0
- data/lib/rails-pg-extras/tasks/all.rake +10 -0
- data/lib/rails-pg-extras/version.rb +1 -1
- data/rails-pg-extras.gemspec +20 -16
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c226cb6af9d0b7979fdf1d40a807689f04fa36c4d61770f01eb6f7f532df5983
|
4
|
+
data.tar.gz: a0818fcaa2c65ff1bcd82d0c7f7d29bf1f9930e0d5ee43a85d7372dac92965c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9353c5983b45fc11bcf508c0fa160441b10693e8160c3147cb235d507ed5d9afdeceb582e7f5967e127448cf96f51763ca2ae418264633b8e13f886ee60b5f2
|
7
|
+
data.tar.gz: 6da8ca3c2b86d0320f5144daf71118815aad6108830378925d64f756a9cc66b6005c10c6855a87a26d962b407a0a311394a6e464241c65efe189b891850ab6d5
|
data/.tool-versions
ADDED
data/README.md
CHANGED
@@ -113,6 +113,38 @@ Keep reading to learn about methods that `diagnose` uses under the hood.
|
|
113
113
|
|
114
114
|
## Available methods
|
115
115
|
|
116
|
+
### `table_info`
|
117
|
+
|
118
|
+
This method displays metadata metrics for all or a selected table. You can use it to check the table's size, its cache hit metrics, and whether it is correctly indexed. Many sequential scans or no index scans are potential indicators of misconfigured indexes. This method aggregates data provided by other methods in an easy to analyze summary format.
|
119
|
+
|
120
|
+
```ruby
|
121
|
+
RailsPGExtras.table_info(args: { table_name: "users" })
|
122
|
+
|
123
|
+
| Table name | Table size | Table cache hit | Indexes cache hit | Estimated rows | Sequential scans | Indexes scans |
|
124
|
+
+------------+------------+-------------------+--------------------+----------------+------------------+---------------+
|
125
|
+
| users | 2432 kB | 0.999966685701511 | 0.9988780464661853 | 16650 | 2128 | 512496 |
|
126
|
+
|
127
|
+
```
|
128
|
+
|
129
|
+
### `index_info`
|
130
|
+
|
131
|
+
This method returns summary info about database indexes. You can check index size, how often it is used and what percentage of its total size are NULL values. Like the previous method, it aggregates data from other helper methods in an easy-to-digest format.
|
132
|
+
|
133
|
+
```ruby
|
134
|
+
|
135
|
+
RailsPGExtras.index_info(args: { table_name: "users" })
|
136
|
+
|
137
|
+
| Index name | Table name | Columns | Index size | Index scans | Null frac |
|
138
|
+
+-------------------------------+------------+----------------+------------+-------------+-----------+
|
139
|
+
| users_pkey | users | id | 1152 kB | 163007 | 0.00% |
|
140
|
+
| index_users_on_slack_id | users | slack_id | 1080 kB | 258870 | 0.00% |
|
141
|
+
| index_users_on_team_id | users | team_id | 816 kB | 70962 | 0.00% |
|
142
|
+
| index_users_on_uuid | users | uuid | 1032 kB | 0 | 0.00% |
|
143
|
+
| index_users_on_block_uuid | users | block_uuid | 776 kB | 19502 | 100.00% |
|
144
|
+
| index_users_on_api_auth_token | users | api_auth_token | 1744 kB | 156 | 0.00% |
|
145
|
+
|
146
|
+
```
|
147
|
+
|
116
148
|
### `cache_hit`
|
117
149
|
|
118
150
|
```ruby
|
@@ -24,4 +24,14 @@ namespace :pg_extras do
|
|
24
24
|
task diagnose: :establish_connection do
|
25
25
|
RailsPGExtras.diagnose
|
26
26
|
end
|
27
|
+
|
28
|
+
desc "Display tables metadata metrics"
|
29
|
+
task table_info: :establish_connection do
|
30
|
+
RailsPGExtras.table_info
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "Display indexes metadata metrics"
|
34
|
+
task index_info: :establish_connection do
|
35
|
+
RailsPGExtras.index_info
|
36
|
+
end
|
27
37
|
end
|
data/rails-pg-extras.gemspec
CHANGED
@@ -3,20 +3,24 @@ lib = File.expand_path('../lib', __FILE__)
|
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require 'rails-pg-extras/version'
|
5
5
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "rails-pg-extras"
|
8
|
+
s.version = RailsPGExtras::VERSION
|
9
|
+
s.authors = ["pawurb"]
|
10
|
+
s.email = ["contact@pawelurbanek.com"]
|
11
|
+
s.summary = %q{ Rails PostgreSQL performance database insights }
|
12
|
+
s.description = %q{ Rails port of Heroku PG Extras. The goal of this project is to provide a powerful insights into PostgreSQL database for Ruby on Rails apps that are not using the default Heroku PostgreSQL plugin. }
|
13
|
+
s.homepage = "http://github.com/pawurb/rails-pg-extras"
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = s.files.grep(%r{^(spec)/})
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.license = "MIT"
|
18
|
+
s.add_dependency "ruby-pg-extras", RailsPGExtras::VERSION
|
19
|
+
s.add_dependency "activerecord"
|
20
|
+
s.add_development_dependency "rake"
|
21
|
+
s.add_development_dependency "rspec"
|
22
|
+
|
23
|
+
if s.respond_to?(:metadata=)
|
24
|
+
s.metadata = { "rubygems_mfa_required" => "true" }
|
25
|
+
end
|
22
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-pg-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-pg-extras
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2.
|
19
|
+
version: 3.2.7
|
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: 3.2.
|
26
|
+
version: 3.2.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,6 +77,7 @@ extra_rdoc_files: []
|
|
77
77
|
files:
|
78
78
|
- ".circleci/config.yml"
|
79
79
|
- ".gitignore"
|
80
|
+
- ".tool-versions"
|
80
81
|
- Gemfile
|
81
82
|
- LICENSE.txt
|
82
83
|
- README.md
|
@@ -100,8 +101,9 @@ files:
|
|
100
101
|
homepage: http://github.com/pawurb/rails-pg-extras
|
101
102
|
licenses:
|
102
103
|
- MIT
|
103
|
-
metadata:
|
104
|
-
|
104
|
+
metadata:
|
105
|
+
rubygems_mfa_required: 'true'
|
106
|
+
post_install_message:
|
105
107
|
rdoc_options: []
|
106
108
|
require_paths:
|
107
109
|
- lib
|
@@ -116,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
118
|
- !ruby/object:Gem::Version
|
117
119
|
version: '0'
|
118
120
|
requirements: []
|
119
|
-
rubygems_version: 3.
|
120
|
-
signing_key:
|
121
|
+
rubygems_version: 3.1.6
|
122
|
+
signing_key:
|
121
123
|
specification_version: 4
|
122
124
|
summary: Rails PostgreSQL performance database insights
|
123
125
|
test_files:
|