metrics

package
v0.0.0-...-11f2a26 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a metrics client for DC/OS.

func NewClient

func NewClient(baseClient *httpclient.Client) *Client

NewClient creates a new metrics client.

func (*Client) App

func (c *Client) App(agent string, container string) (*Container, error)

App returns the metrics of a certain app.

func (*Client) Node

func (c *Client) Node(agent string) (*Node, error)

Node returns the metrics of a certain node.

func (*Client) Task

func (c *Client) Task(agent string, container string) (*Container, error)

Task returns the metrics of a certain task.

type Container

type Container struct {
	Datapoints []Datapoint `json:"datapoints"`
	Dimensions struct {
		MesosID       string `json:"mesos_id"`
		ClusterID     string `json:"cluster_id"`
		ContainerID   string `json:"container_id"`
		FrameworkName string `json:"framework_name"`
		TaskName      string `json:"task_name"`
		Hostname      string `json:"hostname"`
		Labels        struct {
			DcosClusterID     string `json:"dcos_cluster_id"`
			DcosClusterName   string `json:"dcos_cluster_name"`
			FaultDomainRegion string `json:"fault_domain_region"`
			FaultDomainZone   string `json:"fault_domain_zone"`
			Host              string `json:"host"`
		} `json:"labels"`
	} `json:"dimensions"`
}

Container represents the metrics of a container.

type Datapoint

type Datapoint struct {
	Name      string            `json:"name"`
	Value     float64           `json:"value"`
	Unit      string            `json:"unit"`
	Timestamp time.Time         `json:"timestamp"`
	Tags      map[string]string `json:"tags,omitempty"`
}

Datapoint represents a datapoint of a node.

type Node

type Node struct {
	Datapoints []Datapoint `json:"datapoints"`
	Dimensions struct {
		MesosID   string `json:"mesos_id"`
		ClusterID string `json:"cluster_id"`
		Hostname  string `json:"hostname"`
	} `json:"dimensions"`
}

Node represents the metrics of a node.

Jump to

Keyboard shortcuts

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