model

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 1,210

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentHeartbeatRequest

type AgentHeartbeatRequest struct {
	Hostname string
	Checksum string
}

func (*AgentHeartbeatRequest) String

func (this *AgentHeartbeatRequest) String() string

type AgentPluginsResponse

type AgentPluginsResponse struct {
	Plugins   []string
	Timestamp int64
}

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

type BuiltinMetric struct {
	Metric string
	Tags   string
}

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) ActionId

func (this *Event) ActionId() int

func (*Event) Counter

func (this *Event) Counter() string

func (*Event) ExpressionId

func (this *Event) ExpressionId() int

func (*Event) FormattedTime

func (this *Event) FormattedTime() string

func (*Event) Func

func (this *Event) Func() string

func (*Event) MaxStep

func (this *Event) MaxStep() int

func (*Event) Metric

func (this *Event) Metric() string

func (*Event) Note

func (this *Event) Note() string

func (*Event) Operator

func (this *Event) Operator() string

func (*Event) Priority

func (this *Event) Priority() int

func (*Event) RightValue

func (this *Event) RightValue() float64

func (*Event) StrategyId

func (this *Event) StrategyId() int

func (*Event) String

func (this *Event) String() string

func (*Event) Tpl

func (this *Event) Tpl() *Template

func (*Event) TplId

func (this *Event) TplId() int

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 GraphDeleteParam

type GraphDeleteParam struct {
	Endpoint string `json:"endpoint"`
	Metric   string `json:"metric"`
	Step     int    `json:"step"`
	DsType   string `json:"dstype"`
	Tags     string `json:"tags"`
}

type GraphDeleteResp

type GraphDeleteResp struct {
}

type GraphFullyInfo

type GraphFullyInfo struct {
	Endpoint  string `json:"endpoint"`
	Counter   string `json:"counter"`
	ConsolFun string `json:"consolFun"`
	Step      int    `json:"step"`
	Filename  string `json:"filename"`
	Addr      string `json:"addr"`
}

type GraphInfoParam

type GraphInfoParam struct {
	Endpoint string `json:"endpoint"`
	Counter  string `json:"counter"`
}

type GraphInfoResp

type GraphInfoResp struct {
	ConsolFun string `json:"consolFun"`
	Step      int    `json:"step"`
	Filename  string `json:"filename"`
}

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) Checksum

func (t *GraphItem) Checksum() string

func (*GraphItem) PrimaryKey

func (this *GraphItem) PrimaryKey() string

func (*GraphItem) String

func (this *GraphItem) String() string

func (*GraphItem) UUID

func (this *GraphItem) UUID() string

type GraphLastParam

type GraphLastParam struct {
	Endpoint string `json:"endpoint"`
	Counter  string `json:"counter"`
}

type GraphLastResp

type GraphLastResp struct {
	Endpoint string   `json:"endpoint"`
	Counter  string   `json:"counter"`
	Value    *RRDData `json:"value"`
}

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 GraphQueryResponse struct {
	Endpoint string     `json:"endpoint"`
	Counter  string     `json:"counter"`
	DsType   string     `json:"dstype"`
	Step     int        `json:"step"`
	Values   []*RRDData `json:"Values"` //大写为了兼容已经再用这个api的用户
}

type HistoryData

type HistoryData struct {
	Timestamp int64   `json:"timestamp"`
	Value     float64 `json:"value"`
}

type Host

type Host struct {
	Id   int
	Name string
}

func (*Host) String

func (this *Host) String() string

type HostStrategy

type HostStrategy struct {
	Hostname   string     `json:"hostname"`
	Strategies []Strategy `json:"strategies"`
}

type JsonFloat

type JsonFloat float64

func (JsonFloat) MarshalJSON

func (v JsonFloat) MarshalJSON() ([]byte, error)

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

func (this *JudgeItem) PrimaryKey() string

func (*JudgeItem) String

func (this *JudgeItem) String() string

type MetaData

type MetaData struct {
	Metric      string            `json:"metric"`
	Endpoint    string            `json:"endpoint"`
	Timestamp   int64             `json:"timestamp"`
	Step        int64             `json:"step"`
	Value       float64           `json:"value"`
	CounterType string            `json:"counterType"`
	Tags        map[string]string `json:"tags"`
}

func (*MetaData) PK

func (t *MetaData) PK() string

func (*MetaData) String

func (t *MetaData) String() string

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 NewNodataConfig(id int, name string, objType string, endpoint string, metric string, tags map[string]string, dstype string, step int64, mock float64) *NodataConfig

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 NullRpcRequest

type NullRpcRequest struct {
}

type RRDData

type RRDData struct {
	Timestamp int64     `json:"timestamp"`
	Value     JsonFloat `json:"value"`
}

func NewRRDData

func NewRRDData(ts int64, val float64) *RRDData

func (*RRDData) String

func (this *RRDData) String() string

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"`
}

func (*Strategy) String

func (this *Strategy) String() string

type Template

type Template struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	ParentId int    `json:"parentId"`
	ActionId int    `json:"actionId"`
	Creator  string `json:"creator"`
}

func (*Template) String

func (this *Template) String() string

type TransferResponse

type TransferResponse struct {
	Message string
	Total   int
	Invalid int
	Latency int64
}

func (*TransferResponse) String

func (this *TransferResponse) String() string

type TsdbItem

type TsdbItem struct {
	Metric    string            `json:"metric"`
	Tags      map[string]string `json:"tags"`
	Value     float64           `json:"value"`
	Timestamp int64             `json:"timestamp"`
}

func (*TsdbItem) String

func (this *TsdbItem) String() string

func (*TsdbItem) TsdbString

func (this *TsdbItem) TsdbString() (s string)

Jump to

Keyboard shortcuts

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