util

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TransformAndRecordError

func TransformAndRecordError(err error, metrics *RequestMetrics) error

Transforms errors to grpc-compatible error types and optionally truncates it if necessary.

Types

type RequestMetrics

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

Per-endpoint request metrics.

func NewRequestMetrics

func NewRequestMetrics(scope promutils.Scope, method string) RequestMetrics

func (*RequestMetrics) Record

func (m *RequestMetrics) Record(code codes.Code)

func (*RequestMetrics) Success

func (m *RequestMetrics) Success()

func (*RequestMetrics) Time

func (m *RequestMetrics) Time(fn func())

Jump to

Keyboard shortcuts

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