-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pgxpool-stats
- Loading branch information
Showing
7 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ type config struct { | |
traceCopyFrom bool | ||
tracePrepare bool | ||
traceConnect bool | ||
traceAcquire bool | ||
poolStats bool | ||
statsdClient internal.StatsdClient | ||
} | ||
|
@@ -31,6 +32,7 @@ func defaultConfig() *config { | |
traceCopyFrom: true, | ||
tracePrepare: true, | ||
traceConnect: true, | ||
traceAcquire: true, | ||
} | ||
} | ||
|
||
|
@@ -79,6 +81,13 @@ func WithTraceCopyFrom(enabled bool) Option { | |
} | ||
} | ||
|
||
// WithTraceAcquire enables tracing pgxpool connection acquire calls. | ||
func WithTraceAcquire(enabled bool) Option { | ||
return func(c *config) { | ||
c.traceAcquire = enabled | ||
} | ||
} | ||
|
||
// WithTracePrepare enables tracing prepared statements. | ||
// | ||
// conn, err := pgx.Connect(ctx, "postgres://user:[email protected]:5432/dbname", pgx.WithTraceConnect()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters