Documentation ¶
Index ¶
- Constants
- func CollectAllSchemas(ctx context.Context, server *state.Server, collectionOpts state.CollectionOpts, ...) (state.PersistedState, state.TransientState, error)
- func CurrentDatabaseName(ctx context.Context, db *sql.DB) (result string, err error)
- func CurrentDatabaseOid(ctx context.Context, db *sql.DB) (result state.Oid, err error)
- func EstablishConnection(ctx context.Context, server *state.Server, logger *util.Logger, ...) (connection *sql.DB, err error)
- func GetBackendCounts(ctx context.Context, logger *util.Logger, db *sql.DB, ...) ([]state.PostgresBackendCount, error)
- func GetBackends(ctx context.Context, logger *util.Logger, db *sql.DB, ...) ([]state.PostgresBackend, error)
- func GetColumnStats(ctx context.Context, logger *util.Logger, db *sql.DB, ...) (state.PostgresColumnStatsMap, error)
- func GetDataDirectory(server *state.Server, settings []state.PostgresSetting) string
- func GetDatabases(ctx context.Context, logger *util.Logger, db *sql.DB, ...) ([]state.PostgresDatabase, state.PostgresDatabaseStatsMap, error)
- func GetDatabasesToCollect(server *state.Server, databases []state.PostgresDatabase) []string
- func GetExtensions(ctx context.Context, db *sql.DB, currentDatabaseOid state.Oid) ([]state.PostgresExtension, error)
- func GetFunctionStats(ctx context.Context, db *sql.DB, postgresVersion state.PostgresVersion, ...) (functionStats state.PostgresFunctionStatsMap, err error)
- func GetFunctions(ctx context.Context, logger *util.Logger, db *sql.DB, ...) ([]state.PostgresFunction, error)
- func GetIndexStats(ctx context.Context, db *sql.DB, postgresVersion state.PostgresVersion, ...) (indexStats state.PostgresIndexStatsMap, err error)
- func GetIsAwsAurora(ctx context.Context, db *sql.DB) (bool, error)
- func GetIsReplica(ctx context.Context, logger *util.Logger, db *sql.DB) (bool, error)
- func GetPostgresSetting(ctx context.Context, settingName string, server *state.Server, ...) (string, error)
- func GetPostgresVersion(ctx context.Context, logger *util.Logger, db *sql.DB) (version state.PostgresVersion, err error)
- func GetRelationStats(ctx context.Context, db *sql.DB, postgresVersion state.PostgresVersion, ...) (relStats state.PostgresRelationStatsMap, err error)
- func GetRelationStatsExtended(ctx context.Context, logger *util.Logger, db *sql.DB, ...) (state.PostgresRelationStatsExtendedMap, error)
- func GetRelations(ctx context.Context, db *sql.DB, postgresVersion state.PostgresVersion, ...) ([]state.PostgresRelation, error)
- func GetReplication(ctx context.Context, logger *util.Logger, db *sql.DB, ...) (state.PostgresReplication, error)
- func GetRoles(ctx context.Context, logger *util.Logger, db *sql.DB, ...) ([]state.PostgresRole, error)
- func GetServerStats(ctx context.Context, logger *util.Logger, db *sql.DB, ...) (state.PostgresServerStats, error)
- func GetSettings(ctx context.Context, db *sql.DB) ([]state.PostgresSetting, error)
- func GetStatements(ctx context.Context, server *state.Server, logger *util.Logger, db *sql.DB, ...) (state.PostgresStatementMap, state.PostgresStatementTextMap, ...)
- func GetTypes(ctx context.Context, db *sql.DB, postgresVersion state.PostgresVersion, ...) ([]state.PostgresType, error)
- func GetVacuumProgress(ctx context.Context, logger *util.Logger, db *sql.DB, ...) ([]state.PostgresVacuumProgress, error)
- func LogPgReadFile(ctx context.Context, server *state.Server, ...) (state.PersistedLogState, []state.LogFile, []state.PostgresQuerySample, error)
- func ResetStatements(ctx context.Context, logger *util.Logger, db *sql.DB, systemType string) error
- func RunExplain(ctx context.Context, server *state.Server, inputs []state.PostgresQuerySample, ...) (outputs []state.PostgresQuerySample)
- func SetDefaultStatementTimeout(ctx context.Context, connection *sql.DB, logger *util.Logger, ...) error
- func SetQueryTextStatementTimeout(ctx context.Context, connection *sql.DB, logger *util.Logger, ...) error
- func SetStatementTimeout(ctx context.Context, connection *sql.DB, statementTimeoutMs int32) error
- func StatsHelperExists(ctx context.Context, db *sql.DB, statsHelper string) bool
- func StatsHelperReturnType(ctx context.Context, db *sql.DB, statsHelper string) string
- type FunctionSignature
Constants ¶
View Source
const HelperReadLogFile = `` /* 220-byte string literal not displayed */
View Source
const LogFileSql = "SELECT name FROM pg_catalog.pg_ls_logdir() WHERE modification > pg_catalog.now() - '2 minute'::interval"
View Source
const QueryMarkerSQL string = "/* pganalyze-collector */ "
View Source
const SuperUserReadLogFileSql = `` /* 330-byte string literal not displayed */
Read at most the trailing 10 megabytes of each file
Variables ¶
This section is empty.
Functions ¶
func CollectAllSchemas ¶
func CollectAllSchemas(ctx context.Context, server *state.Server, collectionOpts state.CollectionOpts, logger *util.Logger, ps state.PersistedState, ts state.TransientState) (state.PersistedState, state.TransientState, error)
func CurrentDatabaseName ¶
CurrentDatabaseName - Get name of the database we're currently connected to
func CurrentDatabaseOid ¶
CurrentDatabaseOid - Find OID of the database we're currently connected to
func EstablishConnection ¶
func GetBackendCounts ¶
func GetBackends ¶
func GetColumnStats ¶ added in v0.41.0
func GetDataDirectory ¶ added in v0.52.0
func GetDataDirectory(server *state.Server, settings []state.PostgresSetting) string
GetDataDirectory - Finds the data_directory in the list of settings and returns its current value. Returns an empty string if not found (e.g., the setting is not present due to permissions issues)
func GetDatabases ¶
func GetDatabases(ctx context.Context, logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion) ([]state.PostgresDatabase, state.PostgresDatabaseStatsMap, error)
func GetDatabasesToCollect ¶ added in v0.56.0
func GetDatabasesToCollect(server *state.Server, databases []state.PostgresDatabase) []string
func GetExtensions ¶ added in v0.45.0
func GetFunctionStats ¶
func GetFunctionStats(ctx context.Context, db *sql.DB, postgresVersion state.PostgresVersion, ignoreRegexp string) (functionStats state.PostgresFunctionStatsMap, err error)
func GetFunctions ¶
func GetIndexStats ¶
func GetIsReplica ¶
func GetPostgresSetting ¶
func GetPostgresVersion ¶
func GetPostgresVersion(ctx context.Context, logger *util.Logger, db *sql.DB) (version state.PostgresVersion, err error)
GetPostgresVersion - Reads the version of the connected PostgreSQL server
func GetRelationStats ¶
func GetRelationStatsExtended ¶ added in v0.53.0
func GetRelations ¶
func GetReplication ¶
func GetServerStats ¶ added in v0.47.0
func GetSettings ¶
func GetStatements ¶
func GetStatements(ctx context.Context, server *state.Server, logger *util.Logger, db *sql.DB, globalCollectionOpts state.CollectionOpts, postgresVersion state.PostgresVersion, showtext bool, systemType string) (state.PostgresStatementMap, state.PostgresStatementTextMap, state.PostgresStatementStatsMap, error)
func GetVacuumProgress ¶
func LogPgReadFile ¶ added in v0.45.0
func LogPgReadFile(ctx context.Context, server *state.Server, globalCollectionOpts state.CollectionOpts, logger *util.Logger) (state.PersistedLogState, []state.LogFile, []state.PostgresQuerySample, error)
LogPgReadFile - Gets log files using the pg_read_file function
func ResetStatements ¶
func RunExplain ¶
func RunExplain(ctx context.Context, server *state.Server, inputs []state.PostgresQuerySample, collectionOpts state.CollectionOpts, logger *util.Logger) (outputs []state.PostgresQuerySample)
func SetStatementTimeout ¶
func StatsHelperExists ¶ added in v0.43.0
Types ¶
type FunctionSignature ¶ added in v0.59.0
Source Files ¶
- backend_counts.go
- backends.go
- current_database.go
- data_directory.go
- databases.go
- establish_connection.go
- explain.go
- extensions.go
- functions.go
- helpers.go
- log_pg_read_file.go
- querymarker.go
- relation_column_stats.go
- relation_stats.go
- relation_stats_aux.go
- relation_stats_ext.go
- relations.go
- replication.go
- roles.go
- schema.go
- server_stats.go
- settings.go
- statements.go
- superuser.go
- types.go
- vacuum_progress.go
- version.go
Click to show internal directories.
Click to hide internal directories.