Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ var (
"disabled": {GAUGE, "disabled", 1, "1 if this database is currently disabled, else 0"},
},
"stats_totals": {
"database": {LABEL, "N/A", 1, "N/A"},
"query_count": {COUNTER, "queries_pooled_total", 1, "Total number of SQL queries pooled"},
"query_time": {COUNTER, "queries_duration_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when actively connected to PostgreSQL, executing queries"},
"bytes_received": {COUNTER, "received_bytes_total", 1, "Total volume in bytes of network traffic received by pgbouncer, shown as bytes"},
"requests": {COUNTER, "queries_total", 1, "Total number of SQL requests pooled by pgbouncer, shown as requests"},
"bytes_sent": {COUNTER, "sent_bytes_total", 1, "Total volume in bytes of network traffic sent by pgbouncer, shown as bytes"},
"wait_time": {COUNTER, "client_wait_seconds_total", 1e-6, "Time spent by clients waiting for a server in seconds"},
"xact_count": {COUNTER, "sql_transactions_pooled_total", 1, "Total number of SQL transactions pooled"},
"xact_time": {COUNTER, "server_in_transaction_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when connected to PostgreSQL in a transaction, either idle in transaction or executing queries"},
"client_parse_count": {COUNTER, "client_parses_total", 1, "Total number of prepared statement Parse messages received from clients"},
"server_parse_count": {COUNTER, "server_parses_total", 1, "Total number of prepared statement Parse messages sent by pgbouncer to PostgreSQL"},
"bind_count": {COUNTER, "binds_total", 1, "Total number of prepared statements readied for execution with a Bind message"},
"total_server_assignment_count": {COUNTER, "server_assignments_total", 1, "Total number of client connections which have been served since process start"},
"database": {LABEL, "N/A", 1, "N/A"},
"query_count": {COUNTER, "queries_pooled_total", 1, "Total number of SQL queries pooled"},
"query_time": {COUNTER, "queries_duration_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when actively connected to PostgreSQL, executing queries"},
"bytes_received": {COUNTER, "received_bytes_total", 1, "Total volume in bytes of network traffic received by pgbouncer, shown as bytes"},
"requests": {COUNTER, "queries_total", 1, "Total number of SQL requests pooled by pgbouncer, shown as requests"},
"bytes_sent": {COUNTER, "sent_bytes_total", 1, "Total volume in bytes of network traffic sent by pgbouncer, shown as bytes"},
"wait_time": {COUNTER, "client_wait_seconds_total", 1e-6, "Time spent by clients waiting for a server in seconds"},
"xact_count": {COUNTER, "sql_transactions_pooled_total", 1, "Total number of SQL transactions pooled"},
"xact_time": {COUNTER, "server_in_transaction_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when connected to PostgreSQL in a transaction, either idle in transaction or executing queries"},
"client_parse_count": {COUNTER, "client_parses_total", 1, "Total number of prepared statement Parse messages received from clients"},
"server_parse_count": {COUNTER, "server_parses_total", 1, "Total number of prepared statement Parse messages sent by pgbouncer to PostgreSQL"},
"bind_count": {COUNTER, "binds_total", 1, "Total number of prepared statements readied for execution with a Bind message"},
"server_assignment_count": {COUNTER, "server_assignments_total", 1, "Total number of client connections which have been served since process start"},
},
"pools": {
"database": {LABEL, "N/A", 1, "N/A"},
Expand Down
1 change: 1 addition & 0 deletions collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func TestQueryShowStats(t *testing.T) {

// expected metrics are returned in the same order as the colums
expected := []MetricResult{
{labels: labelMap{"database": "pg0"}, metricType: dto.MetricType_COUNTER, value: -1}, // server_assignment_count
{labels: labelMap{"database": "pg0"}, metricType: dto.MetricType_COUNTER, value: 10}, // xact_count
{labels: labelMap{"database": "pg0"}, metricType: dto.MetricType_COUNTER, value: 40}, // query_count
{labels: labelMap{"database": "pg0"}, metricType: dto.MetricType_COUNTER, value: 220}, // bytes_received
Expand Down