Documentation ¶
Index ¶
- Constants
- func NewClusterIdFilter(ids []int64) *clusterIdFilter
- func SamplesToJson(samples []*Sample) []string
- type AlarmClient
- type AlarmServer
- type Client
- func (c *Client) AliveAlarm() error
- func (c *Client) Close()
- func (c *Client) NodeDiskSizeAlarm(clusterId int64, nodeDiskSizeAlarm *alarmpb.NodeDiskSizeAlarm, desc string, ...) error
- func (c *Client) NodeLeaderCountAlarm(clusterId int64, nodeLeaderCountAlarm *alarmpb.NodeLeaderCountAlarm, ...) error
- func (c *Client) NodeNoHeartbeatAlarm(clusterId int64, nodeNoHbAlarm *alarmpb.NodeNoHeartbeatAlarm, desc string, ...) error
- func (c *Client) RangeNoHeartbeatAlarm(clusterId int64, rangeNoHbAlarm *alarmpb.RangeNoHeartbeatAlarm, desc string, ...) error
- func (c *Client) SimpleAlarm(clusterId uint64, title, content string, samples []*Sample) error
- func (c *Client) TaskLongTimeRunningAlarm(clusterId int64, longTimeRunningAlarm *alarmpb.TaskLongTimeRunning, ...) error
- func (c *Client) TaskTimeoutAlarm(clusterId int64, timeoutAlarm *alarmpb.TaskTimeout, task *taskpb.Task, ...) error
- type Message
- type MessageGateway
- type MessageReceiver
- type MessageTo
- type Sample
- type Server
- func (s *Server) AliveAlarm(ctx context.Context, req *alarmpb.AliveRequest) (*alarmpb.AliveResponse, error)
- func (s *Server) NodeRangeAlarm(ctx context.Context, req *alarmpb.NodeRangeAlarmRequest) (*alarmpb.NodeRangeAlarmResponse, error)
- func (s *Server) SimpleAlarm(ctx context.Context, req *alarmpb.SimpleRequest) (*alarmpb.SimpleResponse, error)
- func (s *Server) TaskAlarm(ctx context.Context, req *alarmpb.TaskAlarmRequest) (*alarmpb.TaskAlarmResponse, error)
- type SimpleReceiver
- type User
Constants ¶
View Source
const ( MESSAGE_LEVEL_INFO = iota MESSAGE_LEVEL_WARN MESSAGE_LEVEL_ERROR )
View Source
const (
MESSAGEGATEWAY_WAIT_QUEUE_LENGTH = 10000
)
Variables ¶
This section is empty.
Functions ¶
func NewClusterIdFilter ¶
func NewClusterIdFilter(ids []int64) *clusterIdFilter
func SamplesToJson ¶ added in v0.6.3
Types ¶
type AlarmClient ¶
type AlarmClient interface { TaskTimeoutAlarm(clusterId int64, timeoutAlarm *alarmpb.TaskTimeout, task *taskpb.Task, desc string, samples []*Sample) error TaskLongTimeRunningAlarm(clusterId int64, longTimeRunningAlarm *alarmpb.TaskLongTimeRunning, task *taskpb.Task, desc string, samples []*Sample) error RangeNoHeartbeatAlarm(clusterId int64, rangeNoHbAlarm *alarmpb.RangeNoHeartbeatAlarm, desc string, samples []*Sample) error NodeNoHeartbeatAlarm(clusterId int64, nodeNoHbAlarm *alarmpb.NodeNoHeartbeatAlarm, desc string, samples []*Sample) error NodeDiskSizeAlarm(clusterId int64, nodeDiskSizeAlarm *alarmpb.NodeDiskSizeAlarm, desc string, samples []*Sample) error NodeLeaderCountAlarm(clusterId int64, nodeLeaderCountAlarm *alarmpb.NodeLeaderCountAlarm, desc string, samples []*Sample) error SimpleAlarm(clusterId uint64, title, content string, samples []*Sample) error Close() }
type AlarmServer ¶
type AlarmServer interface { TaskAlarm(context.Context, *alarmpb.TaskAlarmRequest) (*alarmpb.TaskAlarmResponse, error) NodeRangeAlarm(context.Context, *alarmpb.NodeRangeAlarmRequest) (*alarmpb.NodeRangeAlarmResponse, error) AliveAlarm(context.Context, *alarmpb.AliveRequest) (*alarmpb.AliveResponse, error) SimpleAlarm(ctx context.Context, req *alarmpb.SimpleRequest) (*alarmpb.SimpleResponse, error) }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewAlarmClient ¶
func (*Client) AliveAlarm ¶
func (*Client) NodeDiskSizeAlarm ¶
func (*Client) NodeLeaderCountAlarm ¶
func (*Client) NodeNoHeartbeatAlarm ¶
func (*Client) RangeNoHeartbeatAlarm ¶
func (*Client) SimpleAlarm ¶
func (*Client) TaskLongTimeRunningAlarm ¶
type MessageGateway ¶
type MessageGateway struct {
// contains filtered or unexported fields
}
func NewMessageGateway ¶
func NewMessageGateway(ctx context.Context, addr, alarmServerAddr string, receiver MessageReceiver) *MessageGateway
func (*MessageGateway) PushSampleJson ¶ added in v0.6.3
func (gw *MessageGateway) PushSampleJson(sample string) error
type MessageReceiver ¶
type Sample ¶ added in v0.6.3
type Sample struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewAlarmServer ¶
func (*Server) AliveAlarm ¶
func (s *Server) AliveAlarm(ctx context.Context, req *alarmpb.AliveRequest) (*alarmpb.AliveResponse, error)
func (*Server) NodeRangeAlarm ¶
func (s *Server) NodeRangeAlarm(ctx context.Context, req *alarmpb.NodeRangeAlarmRequest) (*alarmpb.NodeRangeAlarmResponse, error)
func (*Server) SimpleAlarm ¶
func (s *Server) SimpleAlarm(ctx context.Context, req *alarmpb.SimpleRequest) (*alarmpb.SimpleResponse, error)
func (*Server) TaskAlarm ¶
func (s *Server) TaskAlarm(ctx context.Context, req *alarmpb.TaskAlarmRequest) (*alarmpb.TaskAlarmResponse, error)
type SimpleReceiver ¶
type SimpleReceiver struct {
Users []*User
}
func NewSimpleReceiver ¶
func NewSimpleReceiver(users []*User) *SimpleReceiver
func (*SimpleReceiver) GetMailList ¶
func (r *SimpleReceiver) GetMailList(id int64, level int) (ret []string)
func (*SimpleReceiver) GetSmsList ¶
func (r *SimpleReceiver) GetSmsList(id int64, level int) (ret []string)
Click to show internal directories.
Click to hide internal directories.