xorm

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	// contains filtered or unexported fields
}

func NewHook

func NewHook(dbName string, opts ...Option) *Hook

func (*Hook) AfterProcess

func (h *Hook) AfterProcess(c *contexts.ContextHook) error

func (*Hook) BeforeProcess

func (h *Hook) BeforeProcess(c *contexts.ContextHook) (context.Context, error)

type Option

type Option func(*Options)

func WithDurationBuckets

func WithDurationBuckets(buckets []float64) Option

WithDurationBuckets sets the duration buckets of single commands metrics.

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace sets the namespace of all metrics.

func WithStatInterval

func WithStatInterval(interval time.Duration) Option

WithStatInterval sets the duration buckets of single commands metrics.

func WithSubsystem

func WithSubsystem(subsystem string) Option

WithSubsystem sets the namespace of all metrics.

type Options

type Options struct {
	Namespace       string
	Subsystem       string
	DurationBuckets []float64
	StatInterval    time.Duration
}

Options represents options to customize the exported metrics.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns the default options.

func (*Options) Merge

func (options *Options) Merge(opts ...Option)

Jump to

Keyboard shortcuts

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