metrics

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListMetrics added in v0.5.21

func ListMetrics(client *golangsdk.ServiceClient, opts ListMetricsBuilder) pagination.Pager

Types

type ListMetricsBuilder added in v0.5.21

type ListMetricsBuilder interface {
	ToMetricsListMap() (string, error)
}

type ListMetricsRequest added in v0.5.21

type ListMetricsRequest struct {
	// Specifies the dimension. For example, the ECS dimension is instance_id.
	// For details about each service dimension, see Services Interconnected with Cloud Eye.
	// A maximum of three dimensions are supported,
	// and the dimensions are numbered from 0 in dim.{i}=key,value format.
	// The key cannot exceed 32 characters and the value cannot exceed 256 characters.
	// Single dimension: dim.0=instance_id,6f3c6f91-4b24-4e1b-b7d1-a94ac1cb011d
	// Multiple dimensions: dim.0=key,value&dim.1=key,value。
	Dim string `q:"dim,omitempty"`
	// The value ranges from 1 to 1000, and is 1000 by default.
	// This parameter is used to limit the number of query results.
	Limit *int `q:"limit,omitempty"`
	// Specifies the metric ID. For example, if the monitoring metric of an ECS is CPU usage, metric_name is cpu_util.
	MetricName string `q:"metric_name,omitempty"`
	// Query the namespace of a service.
	Namespace string `q:"namespace,omitempty"`
	// Specifies the result sorting method, which is sorted by timestamp.
	// The default value is desc.
	// asc: The query results are displayed in the ascending order.
	// desc: The query results are displayed in the descending order.
	Order string `q:"order,omitempty"`
	// Specifies the paging start value.
	// The format is namespace.metric_name.key:value.
	Start string `q:"start,omitempty"`
}

func (ListMetricsRequest) ToMetricsListMap added in v0.5.21

func (opts ListMetricsRequest) ToMetricsListMap() (string, error)

type ListMetricsResponse added in v0.5.21

type ListMetricsResponse struct {
	// Specifies the list of metric objects.
	Metrics []MetricInfoList `json:"metrics"`
	// Specifies the metadata of query results, including the pagination information.
	MetaData MetaData `json:"meta_data"`
}

func ExtractAllPagesMetrics

func ExtractAllPagesMetrics(r pagination.Page) (ListMetricsResponse, error)

func ExtractMetrics

func ExtractMetrics(r pagination.Page) (ListMetricsResponse, error)

type ListResult

type ListResult struct {
	golangsdk.Result
}

type MetaData

type MetaData struct {
	// Specifies the number of returned results.
	Count int `json:"count"`
	// Specifies the pagination marker.
	Marker string `json:"marker"`
	// Specifies the total number of metrics.
	Total int `json:"total"`
}

type MetricInfoList added in v0.5.21

type MetricInfoList struct {
	// Specifies the metric namespace.
	Namespace string `json:"namespace"`
	// Specifies the metric name, such as cpu_util.
	MetricName string `json:"metric_name"`
	// Specifies the metric unit.
	Unit string `json:"unit"`
	// Specifies the list of metric dimensions.
	Dimensions []MetricsDimension `json:"dimensions"`
}

type MetricsDimension added in v0.5.21

type MetricsDimension struct {
	// Specifies the dimension.
	Name string `json:"name"`
	// Specifies the dimension value, for example, an ECS ID.
	Value string `json:"value"`
}

type MetricsPage

type MetricsPage struct {
	pagination.LinkedPageBase
}

func (MetricsPage) IsEmpty

func (r MetricsPage) IsEmpty() (bool, error)

func (MetricsPage) NextPageURL

func (r MetricsPage) NextPageURL() (string, error)

func (MetricsPage) WrapNextPageURL

func (r MetricsPage) WrapNextPageURL(start string) (string, error)

Jump to

Keyboard shortcuts

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