timing

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB(db sqlize.DB) sqlize.DB

func Tx

func Tx(tx sqlize.Tx) sqlize.Tx

Types

type Stats

type Stats struct {
	Sum      int64
	Count    int64
	ErrCount int64
}

TODO make changes concurrency safe

func (Stats) Avg

func (s Stats) Avg() float64

type Timer

type Timer struct {
	StmtStats map[string]*Stats
	// contains filtered or unexported fields
}

func (Timer) Close

func (t Timer) Close() error

func (Timer) Commit

func (t Timer) Commit() error

func (Timer) Exec

func (t Timer) Exec(query string, args ...interface{}) (sql.Result, error)

func (Timer) Prepare

func (t Timer) Prepare(query string) (*sql.Stmt, error)

func (Timer) Query

func (t Timer) Query(query string, args ...interface{}) (*sql.Rows, error)

func (Timer) QueryRow

func (t Timer) QueryRow(query string, args ...interface{}) *sql.Row

func (Timer) Rollback

func (t Timer) Rollback() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL