gin

package
v0.0.0-...-c0caad5 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// the upstream library supports it.
	RequestCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "probix_apiserver_request_count",
			Help: "Counter of probix apiserver requests broken out for each  method, resource and code.",
		},
		[]string{"method", "resource", "code"},
	)
	RequestErrCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "probix_apiserver_requestErrors_total",
			Help: "Counter of probix apiserver requests broken out for each method, resource and code.",
		},
		[]string{"method", "resource", "code"},
	)
	RequestLatencies = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name: "probix_apiserver_request_latencies_seconds",
			Help: "Response latency distribution in microseconds for method, resource and code.",

			Buckets: probixBuckets,
		},
		[]string{"method", "resource", "code"},
	)
	RequestLatenciesSummary = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "probix_apiserver_request_latencies_seconds_summary",
			Help: "Response latency summary in microseconds for each  method, resource and code.",

			MaxAge:     10 * time.Minute,
			Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
		},
		[]string{"method", "resource", "code"},
	)
)

Functions

func ConfigureRoute

func ConfigureRoute(router *gin.Engine)

ConfigureRoute tbd

func GetMetrics

func GetMetrics(c *gin.Context)

func Metrics

func Metrics() gin.HandlerFunc

func MonitorCount

func MonitorCount(resource, method, code string)

func MonitorErrCount

func MonitorErrCount(resource, method, code string)

func MonitorHistogram

func MonitorHistogram(resource, method, code string, start time.Time)

func MonitorSummary

func MonitorSummary(resource, method, code string, start time.Time)

func NoMethodHandler

func NoMethodHandler() gin.HandlerFunc

NoMethodHandler 未找到请求方法的处理函数

func NoRouteHandler

func NoRouteHandler() gin.HandlerFunc

NoRouteHandler 未找到请求路由的处理函数

func Run

func Run() error

Run

func StartWebServer

func StartWebServer(router *gin.Engine) error

StartWebServer

func TunningWebServer

func TunningWebServer() *gin.Engine

TunningWebServer tbd

Types

type SimplebodyWriter

type SimplebodyWriter struct {
	gin.ResponseWriter
	// contains filtered or unexported fields
}

func (SimplebodyWriter) Write

func (w SimplebodyWriter) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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