pghero 1.5.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +75 -0
  4. data/Gemfile +1 -1
  5. data/README.md +8 -14
  6. data/app/assets/javascripts/pghero/Chart.bundle.js +7512 -5661
  7. data/app/assets/javascripts/pghero/application.js +9 -0
  8. data/app/assets/javascripts/pghero/chartkick.js +511 -152
  9. data/app/assets/javascripts/pghero/highlight.pack.js +2 -0
  10. data/app/assets/stylesheets/pghero/application.css +66 -2
  11. data/app/assets/stylesheets/pghero/arduino-light.css +86 -0
  12. data/app/controllers/pg_hero/home_controller.rb +166 -63
  13. data/app/helpers/pg_hero/base_helper.rb +15 -0
  14. data/app/views/layouts/pg_hero/application.html.erb +4 -3
  15. data/app/views/pg_hero/home/_connections_table.html.erb +2 -9
  16. data/app/views/pg_hero/home/_live_queries_table.html.erb +11 -8
  17. data/app/views/pg_hero/home/_queries_table.html.erb +21 -10
  18. data/app/views/pg_hero/home/_suggested_index.html.erb +1 -1
  19. data/app/views/pg_hero/home/connections.html.erb +19 -1
  20. data/app/views/pg_hero/home/explain.html.erb +1 -1
  21. data/app/views/pg_hero/home/index.html.erb +125 -66
  22. data/app/views/pg_hero/home/index_bloat.html.erb +69 -0
  23. data/app/views/pg_hero/home/live_queries.html.erb +3 -1
  24. data/app/views/pg_hero/home/maintenance.html.erb +11 -7
  25. data/app/views/pg_hero/home/queries.html.erb +10 -0
  26. data/app/views/pg_hero/home/relation_space.html.erb +9 -0
  27. data/app/views/pg_hero/home/show_query.html.erb +107 -0
  28. data/app/views/pg_hero/home/space.html.erb +64 -10
  29. data/app/views/pg_hero/home/system.html.erb +16 -4
  30. data/config/routes.rb +4 -2
  31. data/guides/Linux.md +20 -0
  32. data/guides/Rails.md +30 -4
  33. data/guides/Suggested-Indexes.md +1 -1
  34. data/lib/generators/pghero/config_generator.rb +13 -0
  35. data/lib/generators/pghero/query_stats_generator.rb +7 -1
  36. data/lib/generators/pghero/space_stats_generator.rb +7 -1
  37. data/lib/generators/pghero/templates/config.yml +23 -0
  38. data/lib/generators/pghero/templates/query_stats.rb +1 -1
  39. data/lib/generators/pghero/templates/space_stats.rb +1 -1
  40. data/lib/pghero/database.rb +6 -2
  41. data/lib/pghero/engine.rb +10 -7
  42. data/lib/pghero/methods/basic.rb +83 -11
  43. data/lib/pghero/methods/connections.rb +16 -56
  44. data/lib/pghero/methods/explain.rb +3 -5
  45. data/lib/pghero/methods/indexes.rb +179 -21
  46. data/lib/pghero/methods/kill.rb +2 -2
  47. data/lib/pghero/methods/maintenance.rb +34 -20
  48. data/lib/pghero/methods/queries.rb +28 -45
  49. data/lib/pghero/methods/query_stats.rb +97 -91
  50. data/lib/pghero/methods/{replica.rb → replication.rb} +20 -4
  51. data/lib/pghero/methods/sequences.rb +4 -5
  52. data/lib/pghero/methods/space.rb +101 -8
  53. data/lib/pghero/methods/suggested_indexes.rb +49 -108
  54. data/lib/pghero/methods/system.rb +23 -13
  55. data/lib/pghero/methods/tables.rb +9 -9
  56. data/lib/pghero/methods/users.rb +10 -12
  57. data/lib/pghero/version.rb +1 -1
  58. data/lib/pghero.rb +34 -36
  59. data/lib/tasks/pghero.rake +5 -0
  60. data/test/basic_test.rb +38 -0
  61. data/test/best_index_test.rb +3 -3
  62. data/test/suggested_indexes_test.rb +0 -2
  63. data/test/test_helper.rb +38 -40
  64. metadata +14 -7
  65. data/app/views/pg_hero/home/index_usage.html.erb +0 -27
  66. data/test/explain_test.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 822e5e1791b9a405db29590569bad48b312738aa
4
- data.tar.gz: 628fdcaad3d38fedd644bd2574582c3676cfb37b
3
+ metadata.gz: 28e8f13da0c65fcfae3c3cce03ced64eca97d709
4
+ data.tar.gz: 7b7523fc2d8a1c75cfb3e84d3a826755c2c03adf
5
5
  SHA512:
6
- metadata.gz: f586c4e66499887b8694463665b0be0bf4b90f4428b470635750cd65d83e1071018730f9954819e8203b8b5cafefad360d254e7e843174c3afb4d3a940ffcd51
7
- data.tar.gz: 2a0ef31b0a3a9510ae835535cf9563180974781f9d4d761a2224866a82b5e845ac5750d00709c054700416479bc3492d09d0cc28e978f05cdb76dfd5bc63d628
6
+ metadata.gz: 9a5e9a0fa5d4884d4b3bdf2bfbc953300033022e1d2b2f67edc3b3393b1ba2e40bc38a06887ce36d2ef833e2c2faf41a94d84e908bb2ad063a774d26dd10c77a
7
+ data.tar.gz: 22ef1030b064f7208ad8e030aff13d66ff276246e75be27cb5e11286322ea95a0883fa025a07976116c565061bbfad35f9068368952f2627e0fb2ac130c291ad
data/.travis.yml CHANGED
@@ -3,6 +3,8 @@ rvm: 2.2.4
3
3
  cache: bundler
4
4
  sudo: false
5
5
  script: TRAVIS_CI=1 bundle exec rake test
6
+ addons:
7
+ postgresql: "9.4"
6
8
  before_script:
7
9
  - psql -c 'create database pghero_test;' -U postgres
8
10
  notifications:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,78 @@
1
+ ## 2.0.0
2
+
3
+ New features
4
+
5
+ - Query details page
6
+ - Added check for inactive replication slots
7
+ - Added `table_sizes` method for full table sizes
8
+ - Added syntax highlighting
9
+ - Added `min_size` option to `analyze_tables`
10
+
11
+ Breaking changes
12
+
13
+ - Methods now return symbols for keys instead of strings
14
+ - Methods raise `PgHero::NotEnabled` error when a feature isn’t enabled
15
+ - Requires pg_query 0.9.0+ for suggested indexes
16
+ - Historical query stats require the `pghero_query_stats` table to have `query_hash` and `user` columns
17
+ - Removed `with` option - use:
18
+
19
+ ```ruby
20
+ PgHero.databases[:database2].running_queries
21
+ ```
22
+
23
+ instead of
24
+
25
+ ```ruby
26
+ PgHero.with(:database2) { PgHero.running_queries }
27
+ ```
28
+
29
+ - Removed options from `connection_sources` method
30
+ - Removed `locks` method
31
+
32
+ ## 1.7.0
33
+
34
+ - Fixed migrations for Rails 5.1+
35
+ - Added `analyze`, `analyze_tables`, and `analyze_all` methods
36
+ - Added `pghero:analyze` rake task
37
+ - Fixed system stats display issue
38
+
39
+ ## 1.6.5
40
+
41
+ - Added support for Rails API
42
+ - Added support for Amazon STS
43
+ - Fixed replica check when `hot_standby = on` for primary
44
+
45
+ ## 1.6.4
46
+
47
+ - Only show connection charts if there are connections
48
+ - Fixed duplicate indexes for multiple schemas
49
+ - Fixed display issue for queries without word break
50
+ - Removed maintenance tab for replicas
51
+
52
+ ## 1.6.3
53
+
54
+ - Added 10 second timeout for explain
55
+ - No longer show autovacuum in long running queries
56
+ - Added charts for connections
57
+ - Added new config format
58
+ - Removed Chartkick gem dependency for charts
59
+ - Fixed error when primary database is not PostgreSQL
60
+
61
+ ## 1.6.2
62
+
63
+ - Suggest GiST over GIN for `LIKE` queries again (seeing better performance)
64
+
65
+ ## 1.6.1
66
+
67
+ - Suggest GIN over GiST for `LIKE` queries
68
+
69
+ ## 1.6.0
70
+
71
+ - Removed mostly inactionable items (cache hit rate and index usage)
72
+ - Restored duplicate indexes to homepage
73
+ - Fixed issue with exact duplicate indexes
74
+ - Way better `blocked_queries` method
75
+
1
76
  ## 1.5.3
2
77
 
3
78
  - Fixed Rails 5 error with multiple databases
data/Gemfile CHANGED
@@ -3,4 +3,4 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in pghero.gemspec
4
4
  gemspec
5
5
 
6
- gem "activerecord", "~> 5.0.0"
6
+ gem "activerecord", "~> 5.1.0"
data/README.md CHANGED
@@ -1,28 +1,22 @@
1
1
  # PgHero
2
2
 
3
- A performance dashboard for Postgres
3
+ A performance dashboard for Postgres - health checks, suggested indexes, and more :tada:
4
4
 
5
- [See it in action](https://pghero.herokuapp.com/)
5
+ [See it in action](https://pghero.dokkuapp.com/)
6
6
 
7
- [![Screenshot](https://pghero.herokuapp.com/assets/screenshot-a54dead9c9bfc4c1176b184c5bd97ca1.png)](https://pghero.herokuapp.com/)
7
+ [![Screenshot](https://pghero.dokkuapp.com/assets/screenshot-5a368624ada55b32e7668c96926840f9.png)](https://pghero.dokkuapp.com/)
8
8
 
9
9
  :speech_balloon: Get [handcrafted updates](http://chartkick.us7.list-manage.com/subscribe?u=952c861f99eb43084e0a49f98&id=6ea6541e8e&group[0][16]=true) for new features
10
10
 
11
11
  ## Installation
12
12
 
13
- PgHero can be installed as a standalone app or a Rails engine.
13
+ PgHero is available as a Rails engine, Linux package, and Docker image.
14
14
 
15
- - [Linux](guides/Linux.md) - Ubuntu, Debian, and more
16
- - [Docker](guides/Docker.md)
17
- - [Heroku](guides/Heroku.md)
18
- - [Rails](guides/Rails.md)
19
-
20
- ## Related Projects
15
+ Select your preferred method of installation to get started.
21
16
 
22
- Also check out:
23
-
24
- - [pgsync](https://github.com/ankane/pgsync) - Sync Postgres data to your local machine
25
- - [pgslice](https://github.com/ankane/pgslice) - Postgres partitioning as easy as pie
17
+ - [Rails](guides/Rails.md)
18
+ - [Linux](guides/Linux.md)
19
+ - [Docker](guides/Docker.md)
26
20
 
27
21
  ## Credits
28
22