controllers

package
v1.5.38 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElectionStatusController

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

ElectionStatusController define the controller of election metric.

func NewElectionStatusController

func NewElectionStatusController() *ElectionStatusController

NewElectionStatusController get a new NewElectionStatusController.

func (*ElectionStatusController) BecomeFollower

func (esc *ElectionStatusController) BecomeFollower()

BecomeFollower set metrics that current server become a follower.

func (*ElectionStatusController) BecomeLeader

func (esc *ElectionStatusController) BecomeLeader()

BecomeLeader set metrics that current server become a leader.

func (*ElectionStatusController) BecomeUnknown

func (esc *ElectionStatusController) BecomeUnknown()

BecomeUnknown set metrics that current server become a unknown role.

func (*ElectionStatusController) Collect

func (esc *ElectionStatusController) Collect(ch chan<- prometheus.Metric)

Collect provide metrics collected by prometheus.

func (*ElectionStatusController) Describe

func (esc *ElectionStatusController) Describe(ch chan<- *prometheus.Desc)

Describe provide metrics described by prometheus.

type HttpRequestController

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

HttpRequestController define the controller of http request metric.

func NewHttpRequestController

func NewHttpRequestController(responseTimeWidth []float64) *HttpRequestController

NewHttpRequestController get a new HttpRequestController.

func (*HttpRequestController) Collect

func (hrc *HttpRequestController) Collect(ch chan<- prometheus.Metric)

Collect provide metrics collected by prometheus.

func (*HttpRequestController) Describe

func (hrc *HttpRequestController) Describe(ch chan<- *prometheus.Desc)

Describe provide metrics described by prometheus.

func (*HttpRequestController) Observe

func (hrc *HttpRequestController) Observe(label HttpRequestLabel, responseTimeMillisecond float64)

Observe record the data that about a single http request. With duration time and labels.

type HttpRequestLabel

type HttpRequestLabel struct {
	Code   string `json:"code"`
	Method string `json:"method"`
	Path   string `json:"path"`
}

HttpRequestLabel define the http request metrics labels.

func (*HttpRequestLabel) GetLabels

func (hrl *HttpRequestLabel) GetLabels() prometheus.Labels

GetLabels return the labels data as prometheus.Labels

type MySQLOperationController

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

MySQLOperationController define the controller of mysql operation metric.

func NewMySQLOperationController

func NewMySQLOperationController() *MySQLOperationController

NewMySQLOperationController get a new MySQLOperationController.

func (*MySQLOperationController) Collect

func (moc *MySQLOperationController) Collect(ch chan<- prometheus.Metric)

Collect provide metrics collected by prometheus.

func (*MySQLOperationController) Describe

func (moc *MySQLOperationController) Describe(ch chan<- *prometheus.Desc)

Describe provide metrics described by prometheus.

func (*MySQLOperationController) Observe

func (moc *MySQLOperationController) Observe(operation string, operationTimeMillisecond float64)

Observe record the data that about a single mysql operation. With duration time and operation name.

type ResourceStatusController

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

ResourceStatusController define the controller of resource status metric.

func NewResourceStatusController

func NewResourceStatusController() *ResourceStatusController

NewResourceStatusController get a new ResourceStatusController.

func (*ResourceStatusController) Collect

func (rsc *ResourceStatusController) Collect(ch chan<- prometheus.Metric)

Collect provide metrics collected by prometheus.

func (*ResourceStatusController) Describe

func (rsc *ResourceStatusController) Describe(ch chan<- *prometheus.Desc)

Describe provide metrics described by prometheus.

func (*ResourceStatusController) UpdateCPUTotal

func (rsc *ResourceStatusController) UpdateCPUTotal(label ResourceStatusLabels, value float64)

UpdateCPUTotal set cpu total status with newest data and labels.

func (*ResourceStatusController) UpdateCPUUsed

func (rsc *ResourceStatusController) UpdateCPUUsed(label ResourceStatusLabels, value float64)

UpdateCPUUsed set cpu used status with newest data and labels.

func (*ResourceStatusController) UpdateDiskTotal

func (rsc *ResourceStatusController) UpdateDiskTotal(label ResourceStatusLabels, value float64)

UpdateDiskTotal set disk total status with newest data and labels.

func (*ResourceStatusController) UpdateDiskUsed

func (rsc *ResourceStatusController) UpdateDiskUsed(label ResourceStatusLabels, value float64)

UpdateDiskUsed set disk used status with newest data and labels.

func (*ResourceStatusController) UpdateMemTotal

func (rsc *ResourceStatusController) UpdateMemTotal(label ResourceStatusLabels, value float64)

UpdateMemTotal set mem total status with newest data and labels.

func (*ResourceStatusController) UpdateMemUsed

func (rsc *ResourceStatusController) UpdateMemUsed(label ResourceStatusLabels, value float64)

UpdateMemUsed set mem used status with newest data and labels.

type ResourceStatusLabels

type ResourceStatusLabels struct {
	IP   string
	Zone string
}

ResourceStatusLabels define the http resource status metrics labels.

Jump to

Keyboard shortcuts

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