-
Notifications
You must be signed in to change notification settings - Fork 449
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
144 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ tmp | |
*.so | ||
*.o | ||
*.a | ||
mkmf.log | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ gem "rake" | |
|
||
gem "activerecord", "~> 6.1.0" | ||
gem "activerecord-import" | ||
gem "combustion" | ||
gem "pg" | ||
gem "pg_query" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ gem "rake" | |
|
||
gem "activerecord", "~> 5.1.0" | ||
gem "activerecord-import" | ||
gem "combustion" | ||
gem "pg" | ||
gem "pg_query" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ gem "rake" | |
|
||
gem "activerecord", "~> 5.2.0" | ||
gem "activerecord-import" | ||
gem "combustion" | ||
gem "pg" | ||
gem "pg_query" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ gem "rake" | |
|
||
gem "activerecord", "~> 6.0.0" | ||
gem "activerecord-import" | ||
gem "combustion" | ||
gem "pg" | ||
gem "pg_query" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
require_relative "test_helper" | ||
|
||
class ControllerTest < ActionDispatch::IntegrationTest | ||
def test_index | ||
get pg_hero.root_path | ||
assert_response :success | ||
end | ||
|
||
def test_space | ||
get pg_hero.space_path | ||
assert_response :success | ||
end | ||
|
||
def test_relation_space | ||
get pg_hero.relation_space_path(relation: "users") | ||
assert_response :success | ||
end | ||
|
||
def test_index_bloat | ||
get pg_hero.index_bloat_path | ||
assert_response :success | ||
end | ||
|
||
def test_live_queries | ||
get pg_hero.live_queries_path | ||
assert_response :success | ||
end | ||
|
||
def test_queries | ||
get pg_hero.queries_path | ||
assert_response :success | ||
end | ||
|
||
def test_show_query | ||
get pg_hero.show_query_path(query_hash: 123) | ||
assert_response :success | ||
end | ||
|
||
def test_system | ||
get pg_hero.system_path | ||
assert_response :success | ||
end | ||
|
||
def test_explain | ||
get pg_hero.explain_path | ||
assert_response :success | ||
end | ||
|
||
def test_tune | ||
get pg_hero.tune_path | ||
assert_response :success | ||
end | ||
|
||
def test_connections | ||
get pg_hero.connections_path | ||
assert_response :success | ||
end | ||
|
||
def test_maintenance | ||
get pg_hero.maintenance_path | ||
assert_response :success | ||
end | ||
|
||
def test_kill | ||
# prevent warning for now | ||
# post pg_hero.kill_path(pid: 1_000_000_000) | ||
# assert_redirected_to "/" | ||
end | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test: | ||
adapter: postgresql | ||
database: pghero_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.routes.draw do | ||
mount PgHero::Engine, at: "/" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
ActiveRecord::Schema.define do | ||
enable_extension "pg_stat_statements" | ||
enable_extension "pg_trgm" | ||
enable_extension "ltree" | ||
|
||
create_table :pghero_query_stats, force: true do |t| | ||
t.text :database | ||
t.text :user | ||
t.text :query | ||
t.integer :query_hash, limit: 8 | ||
t.float :total_time | ||
t.integer :calls, limit: 8 | ||
t.timestamp :captured_at | ||
t.index [:database, :captured_at] | ||
end | ||
|
||
create_table :pghero_space_stats, force: true do |t| | ||
t.text :database | ||
t.text :schema | ||
t.text :relation | ||
t.integer :size, limit: 8 | ||
t.timestamp :captured_at | ||
t.index [:database, :captured_at] | ||
end | ||
|
||
create_table :cities, force: true do |t| | ||
t.string :name | ||
end | ||
|
||
create_table :states, force: true do |t| | ||
t.string :name | ||
end | ||
|
||
create_table :users, force: true do |t| | ||
t.integer :city_id | ||
t.integer :login_attempts | ||
t.string :email | ||
t.string :zip_code | ||
t.boolean :active | ||
t.string :country | ||
t.column :tree_path, :ltree | ||
t.column :range, :int4range | ||
t.column :last_known_ip, :inet | ||
t.column :metadata, :jsonb | ||
t.timestamp :created_at | ||
t.timestamp :updated_at | ||
t.index :id # duplicate index | ||
t.index :updated_at | ||
t.index :login_attempts, using: :hash | ||
t.index "country gist_trgm_ops", using: :gist | ||
t.index :tree_path, using: :gist | ||
t.index :range, using: :gist | ||
t.index :created_at, using: :brin | ||
t.index "last_known_ip inet_ops", using: :gist | ||
t.index :metadata, using: :gin | ||
end | ||
end |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters