-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add PGHero to the demo app #1294
Draft
mec
wants to merge
6
commits into
bensheldon:main
Choose a base branch
from
mec:add-pghero-to-demo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on Mar 21, 2024
-
We want to show any helpful performance data in the GoodJob demo app so we are installing PGHero: https://github.com/ankane/pghero We have to add Sprockets to the Rails app so the PGHero assets get loaded correctly, whilst we could have used a more modern asset pipeline, Sprockets is well supported and a simple drop in to get PGHero running. PGHero is available at `/pghero`. We have not enabled: - [Suggested indexes](https://github.com/ankane/pghero/blob/master/guides/Rails.md#suggested-indexes) - [Historical query stats](https://github.com/ankane/pghero/blob/master/guides/Rails.md#query-stats) - [Historical space stats](https://github.com/ankane/pghero/blob/master/guides/Rails.md#historical-space-stats) As these may not be suitable for the demo application and can always be added later.
Configuration menu - View commit details
-
Copy full SHA for 79638b5 - Browse repository at this point
Copy the full SHA 79638b5View commit details -
Add spec to cover PgHero basic auth
We want to be sure PgHero is behind basic auth. This spec validates that once the correct environment variables are set, PgHero will require basic authentication. We have to use the rack_test driver so we can use `basic_authorize` to set the headers, rack_test is the default in RSpec/Capybara, but we have explicitly set the driver just in case.
Configuration menu - View commit details
-
Copy full SHA for d3ae492 - Browse repository at this point
Copy the full SHA d3ae492View commit details -
This does the work to enable historical query stats in PgHero, but the Postgres instance backing the service must also be configured, see: https://github.com/ankane/pghero/blob/master/guides/Rails.md#query-stats We are: - adding the tables to store stats - setting up a GoodJob cron job to collect the stats and clean old ones (the demo app generates a lot of queries) For reference, the recommended settings for `postgres.conf`: ``` shared_preload_libraries = 'pg_stat_statements' pg_stat_statements.track = all pg_stat_statements.max = 10000 track_activity_query_size = 2048 ``` See: https://github.com/ankane/pghero/blob/master/guides/Query-Stats.md
Configuration menu - View commit details
-
Copy full SHA for 639323f - Browse repository at this point
Copy the full SHA 639323fView commit details
Commits on Mar 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0fd1ce7 - Browse repository at this point
Copy the full SHA 0fd1ce7View commit details
Commits on Mar 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7db14d0 - Browse repository at this point
Copy the full SHA 7db14d0View commit details
Commits on Mar 24, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6ab7460 - Browse repository at this point
Copy the full SHA 6ab7460View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.