Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SidecarAllInOneDownloadConfig = map[api.ResourceKind]bool{ api.ResourceKindPod: true, api.ResourceKindNode: false, }
SidecarAllInOneDownloadConfig holds config information specifying whether given native Sidecar resource type supports list download.
Functions ¶
func CreateSidecarClient ¶
func CreateSidecarClient(host string, k8sClient kubernetes.Interface) ( metricapi.MetricClient, error)
CreateSidecarClient creates new Sidecar client. When sidecarHost param is empty string the function assumes that it is running inside a Kubernetes cluster and connects via service proxy. sidecarHost param is in the format of protocol://address:port, e.g., http://localhost:8002.
func DataPointsFromMetricJSONFormat ¶
func DataPointsFromMetricJSONFormat(raw []metricapi.MetricPoint) (dp metricapi.DataPoints)
DataPointsFromMetricJSONFormat converts all the data points from format used by sidecar to our format.
Types ¶
type RequestInterface ¶
type RequestInterface interface { DoRaw(context.Context) ([]byte, error) AbsPath(segments ...string) *rest.Request }
RequestInterface is an interface that allows to make operations on pure request object. Separation is done to allow testing.
type SidecarRESTClient ¶
type SidecarRESTClient interface { // Creates a new GET HTTP request to sidecar, specified by the path param, to the V1 API // endpoint. The path param is without the API prefix, e.g., // /model/namespaces/default/pod-list/foo/metrics/memory-usage Get(path string) RequestInterface HealthCheck() error }
SidecarRESTClient is used to make raw requests to sidecar.