Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeout = time.Second * 20 MetricsPath = "/csemonitor/metric" EnvProjectID = "CSE_PROJECT_ID" )
constant for the cse-collector
Variables ¶
View Source
var (
// /v2/{project}/csemonitor/metric
MetricServerPath = ""
)
variables for cse-collector
Functions ¶
func GetInterfaceName ¶
Types ¶
type CseMonitorClient ¶
type CseMonitorClient struct { Header http.Header URL string Client *httpclient.Requests }
CseMonitorClient is an object for storing client information
func NewCseMonitorClient ¶
func NewCseMonitorClient(header http.Header, url string, tlsConfig *tls.Config) (*CseMonitorClient, error)
NewCseMonitorClient creates an new client for monitoring
func (*CseMonitorClient) PostMetrics ¶
func (cseMonitorClient *CseMonitorClient) PostMetrics(monitorData MonitorData) (err error)
PostMetrics is a functions which sends the monintoring data to monitoring Server
type InterfaceInfo ¶
type InterfaceInfo struct { Name string `json:"name"` Desc string `json:"desc"` QPS float64 `json:"qps"` Latency int `json:"latency"` L995 int `json:"l995"` L99 int `json:"l99"` L90 int `json:"l90"` L75 int `json:"l75"` L50 int `json:"l50"` L25 int `json:"l25"` L5 int `json:"l5"` Rate float64 `json:"rate"` Total int64 `json:"total"` Failure int64 `json:"failure"` ShortCircuited int64 `json:"shortCircuited"` IsCircuitBreakerOpen bool `json:"circuitBreakerOpen"` SemaphoreRejected int64 `json:"semaphoreRejected"` ThreadPoolRejected int64 `json:"threadPoolRejected"` CountTimeout int64 `json:"countTimeout"` FailureRate float64 `json:"failureRate"` // contains filtered or unexported fields }
InterfaceInfo is an object which store the monitoring information of a particular interface
type MonitorData ¶
type MonitorData struct { AppID string `json:"appId"` Version string `json:"version"` Name string `json:"name"` Environment string `json:"environment"` Instance string `json:"instance"` Thread int `json:"thread"` Customs map[string]interface{} `json:"customs"` // ? Interfaces []*InterfaceInfo `json:"interfaces"` CPU float64 `json:"cpu"` Memory map[string]interface{} `json:"memory"` ServiceID string `json:"serviceId"` InstanceID string `json:"instanceId"` }
MonitorData is an object which stores the monitoring information for an application
func NewMonitorData ¶
func NewMonitorData() *MonitorData
NewMonitorData creates a new monitoring object
func (*MonitorData) AppendInterfaceInfo ¶
func (monitorData *MonitorData) AppendInterfaceInfo(cb *hystrix.CircuitBreaker)
Click to show internal directories.
Click to hide internal directories.