util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestDurationBucketsSeconds = append(append(append(append(
	prometheus.LinearBuckets(0.01, 0.01, 5),
	prometheus.LinearBuckets(0.1, 0.1, 5)...),
	prometheus.LinearBuckets(1, 1, 5)...),
	prometheus.LinearBuckets(10, 10, 5)...),
)

define latency buckets to record (seconds)

View Source
var ResponseSizeBuckets = append(append(append(append(
	prometheus.LinearBuckets(100, 100, 5),
	prometheus.LinearBuckets(1000, 1000, 5)...),
	prometheus.LinearBuckets(10000, 10000, 5)...),
	prometheus.LinearBuckets(1000000, 1000000, 5)...),
)

define response size buckets (bytes)

Functions

func AddressToString

func AddressToString(addr *pb.TcpAddress) string

func AddressesToString

func AddressesToString(addrs []pb.TcpAddress) string

func DiffAddresses added in v0.3.1

func DiffAddresses(oldAddrs []pb.TcpAddress, newAddrs []pb.TcpAddress) ([]pb.TcpAddress, []pb.TcpAddress)

func IPToString

func IPToString(ip *pb.IPAddress) string

func IPV4

func IPV4(a1, a2, a3, a4 uint8) *pb.IPAddress

func NewGrpcServer

func NewGrpcServer() *grpc.Server

returns a grpc server pre-configured with prometheus interceptors

func NewMetricsServer added in v0.4.0

func NewMetricsServer(metricsAddr string)

func ParseIPV4

func ParseIPV4(ip string) (*pb.IPAddress, error)

func WithTelemetry added in v0.3.0

func WithTelemetry(handler http.Handler) http.HandlerFunc

instrument HTTP server with prometheus

Types

This section is empty.

Jump to

Keyboard shortcuts

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