github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dcs/v1/instance/ListDCSStatistics.go (about)

     1  package instance
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func ListDCSStatistics(client *golangsdk.ServiceClient) ([]InstanceStatistic, error) {
     9  	raw, err := client.Get(client.ServiceURL("instances", "statistic"), nil, nil)
    10  	if err != nil {
    11  		return nil, err
    12  	}
    13  
    14  	var res []InstanceStatistic
    15  	err = extract.IntoSlicePtr(raw.Body, &res, "statistics")
    16  	return res, err
    17  }
    18  
    19  type InstanceStatistic struct {
    20  	// Incoming traffic (kbit/s) of the DCS instance
    21  	InputKbps string `json:"input_kbps"`
    22  	// Outgoing traffic (kbit/s) of the DCS instance
    23  	OutputKbps string `json:"output_kbps"`
    24  	// DCS instance ID
    25  	InstanceId string `json:"instance_id"`
    26  	// Number of cached data records
    27  	Keys int64 `json:"keys"`
    28  	// Size of the used memory in MB
    29  	UsedMemory int64 `json:"used_memory"`
    30  	// Overall memory size in MB
    31  	MaxMemory int64 `json:"max_memory"`
    32  	// Number of times the GET command is run
    33  	CmdGetCount int64 `json:"cmd_get_count"`
    34  	// Number of times the SET command is run
    35  	CmdSetCount int64 `json:"cmd_set_count"`
    36  	// Percentage of CPU usage
    37  	UsedCpu string `json:"used_cpu"`
    38  }