Skip to content

Commit 28a9935

Browse files
committed
improve README adding description of available metrics & views
1 parent dd1552f commit 28a9935

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,25 @@ db, err = sql.Open("ocsql-sqlite3", "resource.db")
110110
defer ocsql.RecordStats(db, 5 * time.Second)()
111111
```
112112

113+
## Recorded metrics
114+
115+
| Metric | Search suffix | Additional tags |
116+
|------------------------|------------------------|----------------------------|
117+
| Number of Calls | "go.sql/client/calls" |"method", "error", "status" |
118+
| Latency in milliseconds| "go.sql/client/latency"|"method", "error", "status" |
119+
120+
If using RecordStats:
121+
122+
| Metric | Search suffix |
123+
|----------------------------------------------------------|----------------------------------------------|
124+
| Number of open connections | "go.sql/db/connections/open" |
125+
| Number of idle connections | "go.sql/db/connections/idle" |
126+
| Number of active connections | "go.sql/db/connections/active" |
127+
| Total number of connections waited for | "go.sql/db/connections/wait_count" |
128+
| Total time blocked waiting for new connections | "go.sql/db/connections/wait_duration" |
129+
| Total number of closed connections by SetMaxIdleConns | "go.sql/db/connections/idle_close_count" |
130+
| Total number of closed connections by SetConnMaxLifetime | "go.sql/db/connections/lifetime_close_count" |
131+
113132
## jmoiron/sqlx
114133

115134
If using the `sqlx` library with named queries you will need to use the

0 commit comments

Comments
 (0)