Beispiel #1
0
// NewRequest creates a new request helper object for accessing runtime.Objects on a server.
func NewRequest(client HTTPClient, verb string, baseURL *url.URL, apiVersion string,
	codec runtime.Codec) *Request {
	metrics.Register()
	return &Request{
		client:     client,
		verb:       verb,
		baseURL:    baseURL,
		path:       baseURL.Path,
		apiVersion: apiVersion,
		codec:      codec,
	}
}
Beispiel #2
0
// NewRequest creates a new request helper object for accessing runtime.Objects on a server.
func NewRequest(client HTTPClient, verb string, baseURL *url.URL, groupVersion unversioned.GroupVersion, codec runtime.Codec, backoff BackoffManager) *Request {
	if backoff == nil {
		glog.V(2).Infof("Not implementing request backoff strategy.")
		backoff = &NoBackoff{}
	}
	metrics.Register()
	return &Request{
		client:       client,
		verb:         verb,
		baseURL:      baseURL,
		path:         baseURL.Path,
		groupVersion: groupVersion,
		codec:        codec,
		backoffMgr:   backoff,
	}
}
Beispiel #3
0
func init() {
	metrics.Register()
}
Beispiel #4
0
func init() {
	prometheus.MustRegister(requestLatency)
	prometheus.MustRegister(requestResult)
	metrics.Register(&latencyAdapter{requestLatency}, &resultAdapter{requestResult})
}