コード例 #1
0
ファイル: podmetrics.go プロジェクト: kubernetes/dashboard
// Retrieves raw metrics from Heapster.
func getRawMetrics(heapsterClient client.HeapsterClient, metricPath string) ([]byte, error) {
	resultRaw, err := heapsterClient.Get(metricPath).DoRaw()

	if err != nil {
		return make([]byte, 0), err
	}
	return resultRaw, nil
}
コード例 #2
0
// HeapsterUnmarshalType performs heapster GET request to the specifies path and transfers
// the data to the interface provided.
func HeapsterUnmarshalType(client client.HeapsterClient, path string, v interface{}) error {
	rawData, err := client.Get("/model/" + path).DoRaw()
	if err != nil {
		return err
	}
	return json.Unmarshal(rawData, v)
}