Skip to content

Commit 3740975

Browse files
committed
add avg_wait_time and total_server_assignment_count metrics
1 parent da1d268 commit 3740975

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

collector.go

+11-9
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ var (
4545
"disabled": {GAUGE, "disabled", 1, "1 if this database is currently disabled, else 0"},
4646
},
4747
"stats": {
48-
"database": {LABEL, "N/A", 1, "N/A"},
49-
"total_query_count": {COUNTER, "queries_pooled_total", 1, "Total number of SQL queries pooled"},
50-
"total_query_time": {COUNTER, "queries_duration_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when actively connected to PostgreSQL, executing queries"},
51-
"total_received": {COUNTER, "received_bytes_total", 1, "Total volume in bytes of network traffic received by pgbouncer, shown as bytes"},
52-
"total_requests": {COUNTER, "queries_total", 1, "Total number of SQL requests pooled by pgbouncer, shown as requests"},
53-
"total_sent": {COUNTER, "sent_bytes_total", 1, "Total volume in bytes of network traffic sent by pgbouncer, shown as bytes"},
54-
"total_wait_time": {COUNTER, "client_wait_seconds_total", 1e-6, "Time spent by clients waiting for a server in seconds"},
55-
"total_xact_count": {COUNTER, "sql_transactions_pooled_total", 1, "Total number of SQL transactions pooled"},
56-
"total_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"},
48+
"database": {LABEL, "N/A", 1, "N/A"},
49+
"avg_wait_time": {GAUGE, "avg_wait_seconds", 1e-6, "Average time spent by clients waiting for a server, in seconds, for the last stats period"},
50+
"total_query_count": {COUNTER, "queries_pooled_total", 1, "Total number of SQL queries pooled"},
51+
"total_query_time": {COUNTER, "queries_duration_seconds_total", 1e-6, "Total number of seconds spent by pgbouncer when actively connected to PostgreSQL, executing queries"},
52+
"total_received": {COUNTER, "received_bytes_total", 1, "Total volume in bytes of network traffic received by pgbouncer, shown as bytes"},
53+
"total_requests": {COUNTER, "queries_total", 1, "Total number of SQL requests pooled by pgbouncer, shown as requests"},
54+
"total_sent": {COUNTER, "sent_bytes_total", 1, "Total volume in bytes of network traffic sent by pgbouncer, shown as bytes"},
55+
"total_server_assignment_count": {COUNTER, "server_assignments_total", 1, "Total number of client connections which have been served since process start"},
56+
"total_wait_time": {COUNTER, "client_wait_seconds_total", 1e-6, "Time spent by clients waiting for a server in seconds"},
57+
"total_xact_count": {COUNTER, "sql_transactions_pooled_total", 1, "Total number of SQL transactions pooled"},
58+
"total_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"},
5759
},
5860
"pools": {
5961
"database": {LABEL, "N/A", 1, "N/A"},

0 commit comments

Comments
 (0)