crontab

package
v0.0.0-...-8110dd7 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicStatusKey = "%s#%s#%s"
)

Variables

View Source
var (
	RedisState          = newRedisStateCollect()
	TaskState           = newTaskStatusCollect()
	QueueCollectStats   = newQueueCollect()
	TopicLengthStats    = newTopicLengthCollect()
	SystemJobExecStats  = newSystemJobExecCollect()
	TopicScriptsStatus  = newTopicScriptsStatusCheck()
	TopicMachineMetrics = newTopicMachineMetricsCollect()
	TopicAlarmStats     = newTopicAlarmCollect()
)
View Source
var AlarmRetryTh = 100 // retry的报警默认阈值
View Source
var AlarmTh = 200 // 报警默认阈值

Functions

func CleanStatistics

func CleanStatistics(node, queue, topic string) (int64, error)

func CleanTopicRetry

func CleanTopicRetry(node, queue, topic string) (int64, error)

func DBTableCron

func DBTableCron()

func Init

func Init()

func RecoverTopic

func RecoverTopic(node, queue, topic string, count int) (int64, error)

func SendToCgi

func SendToCgi(req *SendToCgiReq) (interface{}, error)

func TaskTestClear

func TaskTestClear()

Types

type BaseResponse

type BaseResponse struct {
	ErrorCode int    `json:"error_code"`
	Error     string `json:"error"`
}

type GatewayStatsItem

type GatewayStatsItem struct {
	TimePeriod   time.Duration
	SuccessCount int64
	FailCount    int64
}

type GatewayStatsResp

type GatewayStatsResp struct {
	BaseResponse
	Data map[string]*GatewayStatsItem `json:"data"`
}

type MachineStatsResp

type MachineStatsResp struct {
	BaseResponse
	Data struct {
		CPU    float64
		Load   float64
		Memory float64
	} `json:"data"`
}

type MuxStatsResp

type MuxStatsResp struct {
	BaseResponse
	Node string
	Data map[string]map[string]struct {
		TimePeriod   time.Duration
		SuccessCount int64
		FailCount    int64
		MaxTime      time.Duration
		MinTime      time.Duration
		TotalTime    time.Duration
	} `json:"data"`
}

type QueueCollect

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

func (*QueueCollect) Get

func (s *QueueCollect) Get(queue string) *dao.QueueHistory

type RedisStateCollect

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

func (*RedisStateCollect) GetAll

func (s *RedisStateCollect) GetAll() []*RedisStatus

func (*RedisStateCollect) Update

func (s *RedisStateCollect) Update()

type RedisStatus

type RedisStatus struct {
	*dao.Storage

	RunStatus string
	Msg       string
}

type RetryErrorResp

type RetryErrorResp struct {
	BaseResponse
	Data []*struct {
		Time     string
		Jobs     string
		SysCode  string
		SysError string
		UserCode string
		UserMsg  string
	} `json:"data"`
}

func GetCGIError

func GetCGIError(node, queue, topic string, count int) (*RetryErrorResp, error)

type SendToCgiReq

type SendToCgiReq struct {
	Queue string `binding:"required" json:"queue"`
	Topic string `binding:"required" json:"topic"`
	Node  string `binding:"required" json:"node"`
	Type  string `binding:"required" json:"type"`
	Value string `binding:"required" json:"value"`
}

type SendToTopicResp

type SendToTopicResp struct {
	BaseResponse
	Data interface{} `json:"data"`
}

type SystemJobExecCollect

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

func (*SystemJobExecCollect) GetCount

func (s *SystemJobExecCollect) GetCount(system string) (uint64, uint64)

type TaskDebugData

type TaskDebugData struct {
	Time string
	Jobs string
}

func GetCGITaskDebug

func GetCGITaskDebug(node, queue string, count int) ([]TaskDebugData, error)

获取cgi错误的 job demo http://localhost:19840/GetCGITaskDebug?queue=queue1&count=10

type TaskStatusCollect

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

func (*TaskStatusCollect) Get

func (s *TaskStatusCollect) Get() []*dao.TaskDetail

func (*TaskStatusCollect) GetSum

func (s *TaskStatusCollect) GetSum() []byte

type TopicAlarmCollect

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

func (*TopicAlarmCollect) Range

func (s *TopicAlarmCollect) Range(f func(key string, entry *TopicAlarmEntry))

type TopicAlarmEntry

type TopicAlarmEntry struct {
	Alarm      int `json:"alarm"`
	AlarmRetry int `json:"alarm_retry"`
}

type TopicLengthCollect

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

func (*TopicLengthCollect) Get

func (s *TopicLengthCollect) Get(queue, topic string) *dao.TopicHistory

func (*TopicLengthCollect) GetByKey

func (s *TopicLengthCollect) GetByKey(key string) *dao.TopicHistory

type TopicLengthResp

type TopicLengthResp struct {
	BaseResponse
	Data struct {
		Normal  int64
		Retry   int64
		Timeout int64
	} `json:"data"`
}

func GetTopicLength

func GetTopicLength(node, queue, topic string) (*TopicLengthResp, error)

type TopicMachineMetric

type TopicMachineMetric struct {
	Node        string
	ConsumeLe50 float64
	ConsumeLe90 float64
	ConsumeLe99 float64
	Succ        float64
	Fail        float64
	SuccQpm     float64
	FailQpm     float64
	Question    string
}

type TopicMachineMetricsCollect

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

func (*TopicMachineMetricsCollect) Get

func (s *TopicMachineMetricsCollect) Get(queue, topic, node string) *TopicMachineMetric

func (*TopicMachineMetricsCollect) GetMetrics

type TopicOperateResp

type TopicOperateResp struct {
	BaseResponse
	Data int64 `json:"data"`
}

type TopicScriptsStatusCheck

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

func (*TopicScriptsStatusCheck) Get

func (s *TopicScriptsStatusCheck) Get(queue, topic, node string) string

func (*TopicScriptsStatusCheck) Update

func (s *TopicScriptsStatusCheck) Update(topic dao.Topic)

Jump to

Keyboard shortcuts

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