This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postgres: configurable table/index limits (#1200)
- Loading branch information
Showing
3 changed files
with
22 additions
and
4 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 |
---|---|---|
|
@@ -62,6 +62,19 @@ | |
# Syntax: | ||
# dsn: postgres://postgres:[email protected]:5432/postgres | ||
# | ||
# - max_db_tables | ||
# Maximum number of tables in the database. | ||
# Table metrics will not be collected for databases that have more tables than max_db_tables. | ||
# Default is 50. 0 means no limit. | ||
# Syntax: | ||
# max_db_tables: 50 | ||
# | ||
# - max_db_indexes | ||
# Maximum number of indexes in the database. | ||
# Index metrics will not be collected for databases that have more indexes than max_db_indexes. 0 means no limit. | ||
# Default is 250. 0 means no limit. | ||
# Syntax: | ||
# max_db_indexes: 250 | ||
# | ||
# [ JOB defaults ]: | ||
# No parameters | ||
|
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 |
---|---|---|
|
@@ -29,6 +29,10 @@ func New() *Postgres { | |
DSN: "postgres://postgres:[email protected]:5432/postgres", | ||
XactTimeHistogram: []float64{.1, .5, 1, 2.5, 5, 10}, | ||
QueryTimeHistogram: []float64{.1, .5, 1, 2.5, 5, 10}, | ||
// charts: 20 x table, 4 x index. | ||
// https://discord.com/channels/847502280503590932/1022693928874549368 | ||
MaxDBTables: 50, | ||
MaxDBIndexes: 250, | ||
}, | ||
charts: baseCharts.Copy(), | ||
dbConns: make(map[string]*dbConn), | ||
|
@@ -52,6 +56,8 @@ type Config struct { | |
DBSelector string `yaml:"collect_databases_matching"` | ||
XactTimeHistogram []float64 `yaml:"transaction_time_histogram"` | ||
QueryTimeHistogram []float64 `yaml:"query_time_histogram"` | ||
MaxDBTables int64 `yaml:"max_db_tables"` | ||
MaxDBIndexes int64 `yaml:"max_db_indexes"` | ||
} | ||
|
||
type ( | ||
|