Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ankane:master #6

Open
wants to merge 176 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
ef740b7
Test with Active Record 7 rc1
ankane Dec 7, 2021
9b03508
Fixed deprecation warnings with Active Record 7
ankane Dec 7, 2021
8b11430
Updated comments [skip ci]
ankane Dec 7, 2021
f891ea5
Fixed CI
ankane Dec 7, 2021
0444c89
Test with Active Record 7 by default
ankane Dec 16, 2021
b1b6857
Version bump to 2.8.2 [skip ci]
ankane Dec 16, 2021
e77dea5
Use stub method [skip ci]
ankane Dec 28, 2021
26a70c5
Updated CI [skip ci]
ankane Dec 28, 2021
110aa0d
Test with Ruby 3.1 on CI
ankane Jan 7, 2022
81901f7
Fixed test warning [skip ci]
ankane Jan 11, 2022
a12c489
Updated Rails docs [skip ci]
ankane Jan 17, 2022
8342641
Fixed Docker link [skip ci]
ankane Jan 29, 2022
1cef17a
Fixed error with walsender queries on live queries page - fixes #394
ankane Mar 12, 2022
bb3f2d0
Added experimental support for Propshaft [skip ci]
ankane Mar 13, 2022
71773b9
Added support for google-apis-monitoring_v3
ankane May 2, 2022
5155757
Version bump to 2.8.3 [skip ci]
ankane May 2, 2022
f7b30f1
Added Debian 11 to Linux instructions - closes #414
ankane May 15, 2022
60973c9
Added Ubuntu 22.04 to Linux docs [skip ci]
ankane Jun 20, 2022
8ad27c7
Improved config pattern - fixes #424
ankane Sep 10, 2022
84af3a5
Fixed CI
ankane Sep 10, 2022
9dfef18
Dropped support for Ruby < 2.7 and Rails < 6
ankane Sep 11, 2022
e9ac173
Removed unneeded code [skip ci]
ankane Sep 11, 2022
9046e25
Dropped support for pg_query < 2
ankane Sep 11, 2022
a2ca10b
Dropped support for Linux packages for EOL versions [skip ci]
ankane Sep 11, 2022
32aeb8b
Changed capture_query_stats to only reset stats for current database …
ankane Sep 11, 2022
495d3ed
Added visualize_url option to config [skip ci]
ankane Sep 11, 2022
550b55d
Updated link [skip ci]
ankane Sep 12, 2022
8d91a4d
Improved status codes
ankane Sep 12, 2022
41a467b
Removed access_key_id, secret_access_key, region, and db_instance_ide…
ankane Sep 12, 2022
ba63858
Removed defined checks [skip ci]
ankane Sep 12, 2022
687ceaa
Dropped support for aws-sdk < 2 [skip ci]
ankane Sep 12, 2022
7374efb
Use to_h instead of Hash[]
ankane Sep 12, 2022
65fc825
Added quoting to identifiers for create_user and drop_user methods
ankane Sep 12, 2022
8660325
Improved url [skip ci]
ankane Sep 12, 2022
51abb3b
Updated gemspec [skip ci]
ankane Sep 13, 2022
87a07b1
Updated license year [skip ci]
ankane Sep 13, 2022
e294cad
Updated changelog [skip ci]
ankane Sep 13, 2022
b488d7e
Updated changelog [skip ci]
ankane Sep 13, 2022
73459f2
Improved code and tests to reset query stats
ankane Sep 13, 2022
5dd053e
Version bump to 3.0.0 [skip ci]
ankane Sep 13, 2022
943a236
Updated upgrading section [skip ci]
ankane Sep 13, 2022
d24a477
Added docs for visualize_url option [skip ci]
ankane Sep 13, 2022
9f77c9d
Updated docs for capture_query_stats config [skip ci]
ankane Sep 13, 2022
1e6d23d
Added note about host.docker.internal on Linux [skip ci]
ankane Sep 17, 2022
5b9bad6
Fixed message when database user does not have permission to reset qu…
ankane Oct 5, 2022
35b1874
Fixed flaky test
ankane Oct 5, 2022
65e3d2c
Version bump to 3.0.1 [skip ci]
ankane Oct 10, 2022
702fe4c
Added Postgres 15 to CI
ankane Oct 15, 2022
1f415e6
Improved Docker note [skip ci]
ankane Dec 14, 2022
a8c8bc8
Test with Ruby 3.2 on CI
ankane Dec 30, 2022
026508c
Fixed CI
ankane Dec 30, 2022
e981247
Check current query stats for explainable query [skip ci]
ankane Jan 5, 2023
65aa2bc
Added support for disabling explain and explain analyze
ankane Jan 5, 2023
5cf3a2a
Fixed CI
ankane Jan 5, 2023
a81bb01
Fixed explain error message leaking data
ankane Jan 5, 2023
80b638e
Version bump to 3.1.0 [skip ci]
ankane Jan 5, 2023
1104494
Added explain option to Docker docs [skip ci]
ankane Jan 5, 2023
f36538f
Updated tests for earlier versions of Postgres [skip ci]
ankane Jan 5, 2023
d9056a2
Removed reset button when historical query stats are enabled - #434
ankane Feb 1, 2023
0880dba
Added support for specifying retention period with clean_query_stats …
ankane Feb 1, 2023
1127fdb
Changed DAYS to KEEP_DAYS [skip ci]
ankane Feb 1, 2023
947961b
Added pghero:clean_space_stats rake task [skip ci]
ankane Feb 2, 2023
5a37874
Updated changelog [skip ci]
ankane Feb 2, 2023
e197872
Switched to require_relative [skip ci]
ankane Feb 2, 2023
731b2e3
Use float for KEEP_DAYS [skip ci]
ankane Feb 3, 2023
64d0b00
Use safe_load [skip ci]
ankane Feb 3, 2023
7664fca
Updated Chartkick and Chart.js [skip ci]
ankane Feb 3, 2023
301e4e7
Added support for pg_query 4 - fixes #443
ankane Feb 22, 2023
548e781
Updated query normalization in tests
ankane Feb 22, 2023
a5c7293
Use full width for slider [skip ci]
ankane Feb 22, 2023
ccd8f38
Version bump to 3.2.0 [skip ci]
ankane Feb 22, 2023
865ab2c
Improved handling of lock timeouts - fixes #444
ankane Feb 24, 2023
b4fcaca
Improved code [skip ci]
ankane Feb 24, 2023
96a7a39
Also handle statement timeouts [skip ci]
ankane Feb 24, 2023
957449d
DRY code
ankane Feb 24, 2023
639ccfd
Simplified code [skip ci]
ankane Feb 24, 2023
d7009e8
Simplified code [skip ci]
ankane Feb 24, 2023
c150e66
Added comment [skip ci]
ankane Feb 24, 2023
4d5be17
Removed extra queries
ankane Feb 24, 2023
7472577
Improved handling of lock timeouts on query details page [skip ci]
ankane Feb 24, 2023
d87d7e1
Added message when indexes not available [skip ci]
ankane Feb 24, 2023
3abf35f
Switched to insert_all! method
ankane Feb 25, 2023
968f85e
Removed unused variable [skip ci]
ankane Feb 25, 2023
d393ca3
Improved code [skip ci]
ankane Feb 25, 2023
8c31f30
Use quote_column_name [skip ci]
ankane Feb 25, 2023
c66c8a9
Use squish from Active Support [skip ci]
ankane Feb 25, 2023
ad6b9b2
Added todo [skip ci]
ankane Feb 25, 2023
0dab6bd
Improved code [skip ci]
ankane Feb 25, 2023
9f6faf7
Added tests for generators
ankane Feb 25, 2023
a20cdea
Simplified time params [skip ci]
ankane Feb 25, 2023
4b7a7b3
Improved style [skip ci]
ankane Feb 25, 2023
5138619
Updated noUiSlider to 15.7.0 [skip ci]
ankane Feb 25, 2023
834d2f8
Improved JavaScript code [skip ci]
ankane Feb 25, 2023
d673449
Improved code [skip ci]
ankane Feb 25, 2023
919760c
Improved code for chart options [skip ci]
ankane Feb 25, 2023
1d9de2c
Revert "Improved code for chart options [skip ci]"
ankane Feb 25, 2023
a557d49
DRY code [skip ci]
ankane Feb 25, 2023
a5d7d85
Use params for links [skip ci]
ankane Feb 25, 2023
759d85e
Added class for pie charts [skip ci]
ankane Feb 25, 2023
6433af1
Updated jQuery to 3.6.3 [skip ci]
ankane Feb 25, 2023
b30aeb6
Updated Highlight.js to 11.7.0 [skip ci]
ankane Feb 26, 2023
e16e43b
Updated changelog [skip ci]
ankane Feb 26, 2023
ccb1751
Improved handling of lock timeouts with sequences - fixes #444
ankane Feb 27, 2023
b9a23a7
Improved timeout pattern
ankane Feb 27, 2023
c9ba227
Version bump to 3.3.0 [skip ci]
ankane Mar 11, 2023
8ef8569
Fixed error with Uglifier - fixes #447
ankane Mar 14, 2023
879143c
Version bump to 3.3.1 [skip ci]
ankane Mar 16, 2023
8f456e3
Added Rails 7.1 to CI
ankane Mar 17, 2023
1c3a52e
Fixed error with suggested indexes and empty statements - fixes #450
ankane Mar 24, 2023
8a8240c
Version bump to 3.3.2 [skip ci]
ankane Apr 13, 2023
d08fdf4
Fixed error with load stats for Azure Flexible Server [skip ci]
ankane Apr 18, 2023
6aeeafa
Fixed error with system stats for Azure Database - fixes #452
ankane Apr 18, 2023
ea4bcda
Version bump to 3.3.3 [skip ci]
ankane Apr 18, 2023
af0615a
Permit configuration to use aliases (#455)
marcocarvalho Apr 29, 2023
7a0e6bc
Updated changelog [skip ci]
ankane Apr 29, 2023
44c29d8
Fixed error with Rails 7.1 - fixes #456 and fixes #461
ankane May 30, 2023
2a9033a
Added Postgres 16 to CI
ankane Jul 4, 2023
9a96bf7
Version bump to 3.3.4 [skip ci]
ankane Sep 5, 2023
ac00457
Removed badge [skip ci]
ankane Sep 6, 2023
770ec9e
Test with Rails 7.1.0.beta1
ankane Sep 13, 2023
9db8bce
Updated changelog [skip ci]
ankane Sep 30, 2023
b9cb204
Test with Rails 7.1
ankane Oct 5, 2023
69e8339
Added support for explaining normalized queries with Postgres 16
ankane Nov 27, 2023
f7f6d6d
Improved error message
ankane Nov 27, 2023
e20165a
Version bump to 3.4.0 [skip ci]
ankane Nov 28, 2023
2f8bbef
Updated checkout action and badge [skip ci]
ankane Dec 1, 2023
2c3b4a8
Updated badge [skip ci]
ankane Dec 1, 2023
7f25fee
Added config.load_defaults to test setup
ankane Dec 24, 2023
079f3e5
Test pg_query 4 on CI [skip ci]
ankane Dec 24, 2023
bef01d1
Test with Ruby 3.3 on CI
ankane Dec 26, 2023
bacbd78
Improved tune page for latest PgTune
ankane Feb 4, 2024
6c725da
Added current stats to query details
ankane Feb 5, 2024
577d71a
Updated license year [skip ci]
ankane Feb 7, 2024
3e8c47b
Updated changelog [skip ci]
ankane Feb 7, 2024
2169a5c
Version bump to 3.4.1 [skip ci]
ankane Feb 7, 2024
488972a
Fixed error with slow_queries method - fixes #489
ankane Feb 20, 2024
1b5d6e1
Added test for slow_queries method
ankane Feb 20, 2024
20d9ffc
Show space usage for materialized views (#485)
fatkodima Feb 20, 2024
53ba89d
Improved test for relation_sizes method
ankane Feb 20, 2024
c0187ce
Improved test for relation_sizes method
ankane Feb 20, 2024
6d1c688
Updated changelog [skip ci]
ankane Feb 20, 2024
9074310
Added option for materialized views
ankane May 4, 2024
78a5f70
Fixed CI
ankane May 4, 2024
47628a0
Revert "Added option for materialized views"
ankane May 4, 2024
c20461e
Updated changelog [skip ci]
ankane May 21, 2024
181815e
Version bump to 3.5.0 [skip ci]
ankane May 21, 2024
d78687a
Added Debian 12 to docs [skip ci]
ankane May 21, 2024
d8ded81
Added Active Record 7.2 to CI
ankane May 30, 2024
6822f80
Test with Rails 7.2.0.beta1 on CI [skip ci]
ankane May 30, 2024
7965375
Test with Active Record 7.2.0.beta2 [skip ci]
ankane Jun 4, 2024
c9d82e2
Fixed error with Active Record main - closes #500
ankane Jun 4, 2024
63f889c
Dropped support for Ruby < 3.1 and Rails < 6.1
ankane Jun 17, 2024
b321b57
Improved style [skip ci]
ankane Jun 18, 2024
58d1bb8
Improved code
ankane Jun 18, 2024
b9c2156
Improved CSP support
ankane Jun 30, 2024
f8781fe
Fixed debug param when historical query stats are enabled [skip ci]
ankane Jun 30, 2024
421c17b
Improved code [skip ci]
ankane Jun 30, 2024
aa27225
Use number_with_delimiter for rows [skip ci]
ankane Jun 30, 2024
248bdab
Removed row progression when not present [skip ci]
ankane Jun 30, 2024
17bccef
Version bump to 3.6.0 [skip ci]
ankane Jul 11, 2024
2b3e5b6
Updated Linux package support [skip ci]
ankane Jul 11, 2024
c4cb291
Test with Rails 7.2.0 on CI
ankane Aug 10, 2024
49d87e0
Added Ubuntu 24.04 to Linux docs [skip ci]
ankane Aug 27, 2024
4b12969
Test with Rails 8.0.0.beta1 on CI [skip ci]
ankane Sep 27, 2024
d44457c
Removed unused method [skip ci]
ankane Oct 7, 2024
0fb4618
Removed unused parameter [skip ci]
ankane Oct 7, 2024
7960910
Replaced connection with with_connection
ankane Oct 7, 2024
0199186
Removed stats_connection from forwarding (did not work since method w…
ankane Oct 7, 2024
27a3e7c
Fixed error when Propshaft is installed but not used [skip ci]
ankane Oct 9, 2024
bd55370
Only add assets to precompile list for Sprockets
ankane Oct 9, 2024
f6202fd
Version bump to 3.6.1 [skip ci]
ankane Oct 15, 2024
fdb409e
Updated changelog [skip ci]
ankane Oct 27, 2024
d4d7504
Test with Rails 8.0.0 on CI
ankane Nov 8, 2024
07d351c
Fixed screenshot [skip ci]
ankane Dec 4, 2024
977d111
Test with Ruby 3.4 on CI [skip ci]
ankane Dec 29, 2024
846ec1b
Updated changelog [skip ci]
ankane Jan 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 27 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,38 @@ name: build
on: [push, pull_request]
jobs:
build:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- ruby: 3.0
gemfile: Gemfile
postgres: 13
- ruby: 2.7
gemfile: gemfiles/activerecord60.gemfile
postgres: 12
- ruby: 2.6
gemfile: gemfiles/activerecord52.gemfile
postgres: 11
- ruby: 2.5
gemfile: gemfiles/activerecord51.gemfile
postgres: 10
- ruby: 2.4
gemfile: gemfiles/activerecord50.gemfile
postgres: 9.6
- ruby: 3.4
gemfile: Gemfile
postgres: 17
- ruby: 3.3
gemfile: gemfiles/activerecord72.gemfile
postgres: 16
- ruby: 3.2
gemfile: gemfiles/activerecord71.gemfile
postgres: 14
- ruby: 3.1
gemfile: gemfiles/activerecord70.gemfile
postgres: 12
- ruby: 3.1
gemfile: gemfiles/activerecord61.gemfile
postgres: 10
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: ankane/setup-postgres@v1
with:
postgres-version: ${{ matrix.postgres }}
config: |
shared_preload_libraries = 'pg_stat_statements'
- run: createdb pghero_test
- run: bundle exec rake test
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: ankane/setup-postgres@v1
with:
postgres-version: ${{ matrix.postgres }}
database: pghero_test
config: |
shared_preload_libraries = 'pg_stat_statements'
- run: bundle exec rake test
102 changes: 100 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,90 @@
## 2.8.2 (unreleased)
## 3.6.1 (2024-10-14)

- Fixed error when Propshaft is installed but not used

## 3.6.0 (2024-07-10)

- Improved CSP support
- Dropped support for Linux packages for Ubuntu 18.04, CentOS 7, and SLES 12
- Dropped support for Ruby < 3.1 and Rails < 6.1

## 3.5.0 (2024-05-21)

- Added materialized views to space page and `relation_sizes` method
- Added Linux package for Debian 12
- Fixed error with `slow_queries` method

## 3.4.1 (2024-02-07)

- Added current stats to query details page
- Improved tune page for latest PgTune

## 3.4.0 (2023-11-28)

- Added support for explaining normalized queries with Postgres 16
- Added Docker image for `linux/arm64`

## 3.3.4 (2023-09-05)

- Fixed support for aliases in config file

## 3.3.3 (2023-04-18)

- Fixed error with system stats for Azure Database

## 3.3.2 (2023-04-12)

- Fixed error with suggested indexes and empty statements

## 3.3.1 (2023-03-15)

- Fixed error with Uglifier

## 3.3.0 (2023-03-11)

- Improved handling of lock timeouts
- Improved syntax highlighting

## 3.2.0 (2023-02-21)

- Added support for pg_query 4
- Added `pghero:clean_space_stats` rake task
- Added support for specifying retention period with `clean_query_stats` and `clean_space_stats`
- Removed reset button when historical query stats are enabled

## 3.1.0 (2023-01-04)

- Fixed explain error message leaking data - [more info](https://github.com/ankane/pghero/issues/439)
- Explain analyze is now opt-in - [more info](https://github.com/ankane/pghero/issues/438)
- Added support for disabling explain and explain analyze
- Added support for visualize without explain analyze
- Added `explain_v2` method

## 3.0.1 (2022-10-09)

- Fixed message when database user does not have permission to reset query stats

## 3.0.0 (2022-09-13)

- Changed `capture_query_stats` to only reset stats for current database in Postgres 12+
- Changed `reset_query_stats` to only reset stats for current database (use `reset_instance_query_stats` to reset stats for entire instance)
- Added `visualize_url` option to config
- Removed `access_key_id`, `secret_access_key`, `region`, and `db_instance_identifier` methods (use `aws_` prefixed methods instead)
- Dropped support for Linux packages for EOL versions
- Dropped support for Ruby < 2.7 and Rails < 6
- Dropped support for pg_query < 2
- Dropped support for aws-sdk < 2

## 2.8.3 (2022-05-01)

- Added support for `google-apis-monitoring_v3`
- Added experimental support for Propshaft
- Fixed error with walsender queries on live queries page

## 2.8.2 (2021-12-15)

- Fixed sorting by name on space page when historical space stats are not enabled
- Fixed deprecation warnings with Active Record 7

## 2.8.1 (2021-03-25)

Expand Down Expand Up @@ -407,4 +491,18 @@ PgHero.with(:database2) { PgHero.running_queries }

## 0.1.0 (2014-07-23)

- First major release
- Improved explanations
- Updated design

## 0.0.3 (2014-07-22)

- Fixed `missing_indexes` method

## 0.0.2 (2014-07-21)

- Added `unused_tables` method
- Added `database_size` method

## 0.0.1 (2014-07-21)

- First release
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ gemspec
gem "minitest", ">= 5"
gem "rake"

gem "activerecord", "~> 6.1.0"
gem "activerecord-import"
gem "activerecord", "~> 8.0.0"
gem "combustion"
gem "pg"
gem "pg_query"
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2021 Andrew Kane, 2008-2014 Heroku (initial queries)
Copyright (c) 2014-2024 Andrew Kane, 2008-2014 Heroku (initial queries)

MIT License

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ A performance dashboard for Postgres

[See it in action](https://pghero.dokkuapp.com/)

[![Screenshot](https://pghero.dokkuapp.com/assets/pghero-ebb9c8e11434fd0e4ead81db88fe255b29cbbc845ec315b79e6c5e25015bc921.png)](https://pghero.dokkuapp.com/)
[![Screenshot](https://pghero.dokkuapp.com/assets/pghero-88a0d052.png)](https://pghero.dokkuapp.com/)

:tangerine: Battle-tested at [Instacart](https://www.instacart.com/opensource)

[![Build Status](https://github.com/ankane/pghero/workflows/build/badge.svg?branch=master)](https://github.com/ankane/pghero/actions) [![Docker Pulls](https://img.shields.io/docker/pulls/ankane/pghero)](https://hub.docker.com/repository/docker/ankane/pghero)
[![Build Status](https://github.com/ankane/pghero/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/pghero/actions)

## Documentation

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ task default: :test
Rake::TestTask.new do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.warning = false # for google-protobuf (pg_query dependency)
end
Loading