You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-11-22 11:02:36 +03:00
Gofmt the code.
This commit is contained in:
@@ -148,7 +148,7 @@ type MetricMap struct {
|
||||
|
||||
// Metric descriptors for dynamically created metrics.
|
||||
var variableMaps = map[string]map[string]ColumnMapping{
|
||||
"pg_runtime_variable": map[string]ColumnMapping{
|
||||
"pg_runtime_variable": {
|
||||
"max_connections": {GAUGE, "Sets the maximum number of concurrent connections.", nil, nil},
|
||||
"max_files_per_process": {GAUGE, "Sets the maximum number of simultaneously open files for each server process.", nil, nil},
|
||||
"max_function_args": {GAUGE, "Shows the maximum number of function arguments.", nil, nil},
|
||||
@@ -184,7 +184,7 @@ func dumpMaps() {
|
||||
}
|
||||
|
||||
var metricMaps = map[string]map[string]ColumnMapping{
|
||||
"pg_stat_bgwriter": map[string]ColumnMapping{
|
||||
"pg_stat_bgwriter": {
|
||||
"checkpoints_timed": {COUNTER, "Number of scheduled checkpoints that have been performed", nil, nil},
|
||||
"checkpoints_req": {COUNTER, "Number of requested checkpoints that have been performed", nil, nil},
|
||||
"checkpoint_write_time": {COUNTER, "Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in milliseconds", nil, nil},
|
||||
@@ -197,7 +197,7 @@ var metricMaps = map[string]map[string]ColumnMapping{
|
||||
"buffers_alloc": {COUNTER, "Number of buffers allocated", nil, nil},
|
||||
"stats_reset": {COUNTER, "Time at which these statistics were last reset", nil, nil},
|
||||
},
|
||||
"pg_stat_database": map[string]ColumnMapping{
|
||||
"pg_stat_database": {
|
||||
"datid": {LABEL, "OID of a database", nil, nil},
|
||||
"datname": {LABEL, "Name of this database", nil, nil},
|
||||
"numbackends": {GAUGE, "Number of backends currently connected to this database. This is the only column in this view that returns a value reflecting current state; all other columns return the accumulated values since the last reset.", nil, nil},
|
||||
@@ -218,7 +218,7 @@ var metricMaps = map[string]map[string]ColumnMapping{
|
||||
"blk_write_time": {COUNTER, "Time spent writing data file blocks by backends in this database, in milliseconds", nil, nil},
|
||||
"stats_reset": {COUNTER, "Time at which these statistics were last reset", nil, nil},
|
||||
},
|
||||
"pg_stat_database_conflicts": map[string]ColumnMapping{
|
||||
"pg_stat_database_conflicts": {
|
||||
"datid": {LABEL, "OID of a database", nil, nil},
|
||||
"datname": {LABEL, "Name of this database", nil, nil},
|
||||
"confl_tablespace": {COUNTER, "Number of queries in this database that have been canceled due to dropped tablespaces", nil, nil},
|
||||
@@ -227,12 +227,12 @@ var metricMaps = map[string]map[string]ColumnMapping{
|
||||
"confl_bufferpin": {COUNTER, "Number of queries in this database that have been canceled due to pinned buffers", nil, nil},
|
||||
"confl_deadlock": {COUNTER, "Number of queries in this database that have been canceled due to deadlocks", nil, nil},
|
||||
},
|
||||
"pg_locks": map[string]ColumnMapping{
|
||||
"pg_locks": {
|
||||
"datname": {LABEL, "Name of this database", nil, nil},
|
||||
"mode": {LABEL, "Type of Lock", nil, nil},
|
||||
"count": {GAUGE, "Number of locks", nil, nil},
|
||||
},
|
||||
"pg_stat_replication": map[string]ColumnMapping{
|
||||
"pg_stat_replication": {
|
||||
"procpid": {DISCARD, "Process ID of a WAL sender process", nil, semver.MustParseRange("<9.2.0")},
|
||||
"pid": {DISCARD, "Process ID of a WAL sender process", nil, semver.MustParseRange(">=9.2.0")},
|
||||
"usesysid": {DISCARD, "OID of the user logged into this WAL sender process", nil, nil},
|
||||
@@ -263,7 +263,7 @@ var metricMaps = map[string]map[string]ColumnMapping{
|
||||
"pg_current_xlog_location": {DISCARD, "pg_current_xlog_location", nil, nil},
|
||||
"pg_xlog_location_diff": {GAUGE, "Lag in bytes between master and slave", nil, semver.MustParseRange(">=9.2.0")},
|
||||
},
|
||||
"pg_stat_activity": map[string]ColumnMapping{
|
||||
"pg_stat_activity": {
|
||||
"datname": {LABEL, "Name of this database", nil, nil},
|
||||
"state": {LABEL, "connection state", nil, semver.MustParseRange(">=9.2.0")},
|
||||
"count": {GAUGE, "number of connections in this state", nil, nil},
|
||||
@@ -283,7 +283,7 @@ type OverrideQuery struct {
|
||||
// Overriding queries for namespaces above.
|
||||
// TODO: validate this is a closed set in tests, and there are no overlaps
|
||||
var queryOverrides = map[string][]OverrideQuery{
|
||||
"pg_locks": []OverrideQuery{
|
||||
"pg_locks": {
|
||||
{
|
||||
semver.MustParseRange(">0.0.0"),
|
||||
`SELECT pg_database.datname,tmp.mode,COALESCE(count,0) as count
|
||||
@@ -307,7 +307,7 @@ var queryOverrides = map[string][]OverrideQuery{
|
||||
},
|
||||
},
|
||||
|
||||
"pg_stat_replication": []OverrideQuery{
|
||||
"pg_stat_replication": {
|
||||
{
|
||||
semver.MustParseRange(">=9.2.0"),
|
||||
`
|
||||
@@ -327,7 +327,7 @@ var queryOverrides = map[string][]OverrideQuery{
|
||||
},
|
||||
},
|
||||
|
||||
"pg_stat_activity": []OverrideQuery{
|
||||
"pg_stat_activity": {
|
||||
// This query only works
|
||||
{
|
||||
semver.MustParseRange(">=9.2.0"),
|
||||
|
||||
Reference in New Issue
Block a user