Documentation
¶
Index ¶
- Constants
- type AgentHeartbeatRequest
- type AgentPluginsResponse
- type AgentReportRequest
- type AgentUpdateInfo
- type BuiltinMetric
- type BuiltinMetricResponse
- type BuiltinMetricSlice
- type Event
- func (this *Event) ActionId() int
- func (this *Event) Counter() string
- func (this *Event) ExpressionId() int
- func (this *Event) FormattedTime() string
- func (this *Event) Func() string
- func (this *Event) MaxStep() int
- func (this *Event) Metric() string
- func (this *Event) Note() string
- func (this *Event) Operator() string
- func (this *Event) Priority() int
- func (this *Event) RightValue() float64
- func (this *Event) StrategyId() int
- func (this *Event) String() string
- func (this *Event) TplId() int
- type Expression
- type ExpressionResponse
- type GraphAccurateQueryParam
- type GraphAccurateQueryResponse
- type GraphFullyInfo
- type GraphInfoParam
- type GraphInfoResp
- type GraphItem
- type GraphLastParam
- type GraphLastResp
- type GraphQueryParam
- type GraphQueryResponse
- type HistoryData
- type Host
- type HostStrategy
- type JsonFloat
- type JsonMetaData
- type JudgeItem
- type MeasurementsProperty
- type MetaData
- type MetricValue
- type NodataConfig
- type NodataItem
- type NqmAgent
- type NqmTarget
- type NqmTaskRequest
- type NqmTaskResponse
- type NullRpcRequest
- type RRDData
- type SimpleRpcResponse
- type StrategiesResponse
- type Strategy
- type Template
- type TransferResponse
- type TsdbItem
Constants ¶
View Source
const ( // Value of undefined id UNDEFINED_ID = -1 UNDEFINED_ISP_ID = int16(UNDEFINED_ID) UNDEFINED_PROVINCE_ID = int16(UNDEFINED_ID) UNDEFINED_CITY_ID = int16(UNDEFINED_ID) // Value of undefined string UNDEFINED_STRING = "<UNDEFINED>" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentHeartbeatRequest ¶
func (*AgentHeartbeatRequest) String ¶
func (this *AgentHeartbeatRequest) String() string
type AgentPluginsResponse ¶
func (*AgentPluginsResponse) String ¶
func (this *AgentPluginsResponse) String() string
type AgentReportRequest ¶
type AgentReportRequest struct {
Hostname string
IP string
AgentVersion string
PluginVersion string
}
func (*AgentReportRequest) String ¶
func (this *AgentReportRequest) String() string
type AgentUpdateInfo ¶
type AgentUpdateInfo struct {
LastUpdate int64
ReportRequest *AgentReportRequest
}
type BuiltinMetric ¶
e.g. net.port.listen or proc.num
func (*BuiltinMetric) String ¶
func (this *BuiltinMetric) String() string
type BuiltinMetricResponse ¶
type BuiltinMetricResponse struct {
Metrics []*BuiltinMetric
Checksum string
Timestamp int64
}
func (*BuiltinMetricResponse) String ¶
func (this *BuiltinMetricResponse) String() string
type BuiltinMetricSlice ¶
type BuiltinMetricSlice []*BuiltinMetric
func (BuiltinMetricSlice) Len ¶
func (this BuiltinMetricSlice) Len() int
func (BuiltinMetricSlice) Less ¶
func (this BuiltinMetricSlice) Less(i, j int) bool
func (BuiltinMetricSlice) Swap ¶
func (this BuiltinMetricSlice) Swap(i, j int)
type Event ¶
type Event struct {
Id string `json:"id"`
Strategy *Strategy `json:"strategy"`
Expression *Expression `json:"expression"`
Status string `json:"status"` // OK or PROBLEM
Endpoint string `json:"endpoint"`
LeftValue float64 `json:"leftValue"`
CurrentStep int `json:"currentStep"`
EventTime int64 `json:"eventTime"`
PushedTags map[string]string `json:"pushedTags"`
}
机器监控和实例监控都会产生Event,共用这么一个struct
func (*Event) ExpressionId ¶
func (*Event) FormattedTime ¶
func (*Event) RightValue ¶
func (*Event) StrategyId ¶
type Expression ¶
type Expression struct {
Id int `json:"id"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Func string `json:"func"` // e.g. max(#3) all(#3)
Operator string `json:"operator"` // e.g. < !=
RightValue float64 `json:"rightValue"` // critical value
MaxStep int `json:"maxStep"`
Priority int `json:"priority"`
Note string `json:"note"`
ActionId int `json:"actionId"`
}
func (*Expression) String ¶
func (this *Expression) String() string
type ExpressionResponse ¶
type ExpressionResponse struct {
Expressions []*Expression `json:"expressions"`
}
type GraphAccurateQueryParam ¶
type GraphAccurateQueryParam struct {
Checksum string `json:"checksum"`
Start int64 `json:"start"`
End int64 `json:"end"`
ConsolFun string `json:"consolFuc"`
DsType string `json:"dsType"`
Step int `json:"step"`
}
页面上已经可以看到DsType和Step了,直接带进查询条件,Graph更易处理
type GraphAccurateQueryResponse ¶
type GraphAccurateQueryResponse struct {
Values []*RRDData `json:"values"`
}
type GraphFullyInfo ¶
type GraphInfoParam ¶
type GraphInfoResp ¶
type GraphItem ¶
type GraphItem struct {
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Value float64 `json:"value"`
Timestamp int64 `json:"timestamp"`
DsType string `json:"dstype"`
Step int `json:"step"`
Heartbeat int `json:"heartbeat"`
Min string `json:"min"`
Max string `json:"max"`
}
DsType 即RRD中的Datasource的类型:GAUGE|COUNTER|DERIVE
func (*GraphItem) PrimaryKey ¶
type GraphLastParam ¶
type GraphLastResp ¶
type GraphQueryParam ¶
type GraphQueryParam struct {
Start int64 `json:"start"`
End int64 `json:"end"`
ConsolFun string `json:"consolFuc"`
Endpoint string `json:"endpoint"`
Counter string `json:"counter"`
Step int `json:"step"`
}
ConsolFun 是RRD中的概念,比如:MIN|MAX|AVERAGE
type GraphQueryResponse ¶
type HistoryData ¶
type HostStrategy ¶
type JsonMetaData ¶
type JsonMetaData struct {
Metric string `json:"metric"`
Endpoint string `json:"endpoint"`
Timestamp int64 `json:"timestamp"`
Step int64 `json:"step"`
Value interface{} `json:"value"`
CounterType string `json:"counterType"`
Tags string `json:"tags"`
}
Same As `MetricValue`
func (*JsonMetaData) String ¶
func (t *JsonMetaData) String() string
type JudgeItem ¶
type JudgeItem struct {
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Value float64 `json:"value"`
Timestamp int64 `json:"timestamp"`
JudgeType string `json:"judgeType"`
Tags map[string]string `json:"tags"`
}
func (*JudgeItem) PrimaryKey ¶
type MeasurementsProperty ¶
type MetaData ¶
type MetricValue ¶
type MetricValue struct {
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Value interface{} `json:"value"`
Step int64 `json:"step"`
Type string `json:"counterType"`
Tags string `json:"tags"`
Timestamp int64 `json:"timestamp"`
}
func (*MetricValue) String ¶
func (this *MetricValue) String() string
type NodataConfig ¶
type NodataConfig struct {
Id int `json:"id"`
Name string `json:"name"`
ObjType string `json:"objType"`
Endpoint string `json:"endpoint"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Type string `json:"type"`
Step int64 `json:"step"`
Mock float64 `json:"mock"`
}
func NewNodataConfig ¶
func (*NodataConfig) String ¶
func (this *NodataConfig) String() string
type NodataItem ¶
type NodataItem struct {
Counter string `json:"counter"`
Ts int64 `json:"ts"`
FStatus string `json:"fstatus"`
FTs int64 `json:"fts"`
}
func (*NodataItem) String ¶
func (this *NodataItem) String() string
type NqmAgent ¶
type NqmAgent struct {
// The id of agent
Id int
// The name of agent
Name string
// The id of ISP, UNDEFINED_ID means there is not such data for this target
IspId int16
// The name of ISP
IspName string
// The id of province, UNDEFINED_ID means there is not such data for this target
ProvinceId int16
// The name of province
ProvinceName string
// The id of city, UNDEFINED_ID means there is not such data for this target
CityId int16
// The name of city
CityName string
}
Represents the data of agent
type NqmTarget ¶
type NqmTarget struct {
// The id of target
Id int
// The IP address or FQDN used by ping command
Host string
// The id of ISP, UNDEFINED_ID means there is not such data for this target
IspId int16
// The name of ISP
IspName string
// The id of province, UNDEFINED_ID means there is not such data for this target
ProvinceId int16
// The name of province
ProvinceName string
// The id of city, UNDEFINED_ID means there is not such data for this target
CityId int16
// The name of city
CityName string
// The tag of the target, UNDEFINED_STRING means no such data for this target
NameTag string
}
Represents the data of target used by NQM agent
type NqmTaskRequest ¶
type NqmTaskRequest struct {
// The connection id of agent(used to identify task configruation)
ConnectionId string `valid:"required"`
// The hostname of agent
Hostname string `valid:"required"`
// The IP address of agent
// Could be IPv4 or IPv6 format
IpAddress string `valid:"required"`
}
NqmTaskRequest represents the request for ping task by NQM agent
type NqmTaskResponse ¶
type NqmTaskResponse struct {
// Whether or not the task should be performed
NeedPing bool
// The data of agent
// nil if there is no need for ping
Agent *NqmAgent
// The list of target hosts to be probed(ping)
// nil if there is no need for ping
Targets []NqmTarget
// The command/arguments of command to be executed
// nil if there is no need for ping
Measurements map[string]MeasurementsProperty
}
NqmTaskResponse represents the response for ping task requested from NQM agent
If NeedPing is false, Targets and Command would be empty array
type NullRpcRequest ¶
type NullRpcRequest struct {
}
type RRDData ¶
func NewRRDData ¶
type SimpleRpcResponse ¶
type SimpleRpcResponse struct {
Code int `json:"code"`
}
code == 0 => success code == 1 => bad request
func (*SimpleRpcResponse) String ¶
func (this *SimpleRpcResponse) String() string
type StrategiesResponse ¶
type StrategiesResponse struct {
HostStrategies []*HostStrategy `json:"hostStrategies"`
}
type Strategy ¶
type Strategy struct {
Id int `json:"id"`
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Func string `json:"func"` // e.g. max(#3) all(#3)
Operator string `json:"operator"` // e.g. < !=
RightValue float64 `json:"rightValue"` // critical value
MaxStep int `json:"maxStep"`
Priority int `json:"priority"`
Note string `json:"note"`
Tpl *Template `json:"tpl"`
}
type Template ¶
type TransferResponse ¶
func (*TransferResponse) String ¶
func (this *TransferResponse) String() string
Click to show internal directories.
Click to hide internal directories.