proxy.golang.org : github.com/easyops-cn/sqlhooks : v1.3.0
This example shows how to instrument sql queries in order to display the time that they consume package main import ( ) // Hooks satisfies the sqlhook.Hooks interface type Hooks struct {} // Before hook will print the query with it's args and return the context with the timestamp // After hook will get the timestamp registered on the Before hook and print the elapsed time /* Output should look like: > CREATE TABLE t (id INTEGER, text VARCHAR(16)) []. took: 121.238µs > INSERT into t (text) VALUES(?), (?) ["foo" "bar"]. took: 36.364µs > SELECT id, text FROM t []. took: 4.653µs */
Registry -
Documentation -
Download -
JSON
purl: pkg:golang/github.com/easyops-cn/[email protected]
Published:
Indexed:
- github.com/go-sql-driver/mysql v1.4.1
- github.com/lib/pq v1.2.0
- github.com/mattn/go-sqlite3 v1.10.0
- github.com/opentracing/opentracing-go v1.1.0
- github.com/stretchr/testify v1.4.0