Documentation
¶
Index ¶
- func AddDefaultOnClientUUID(uuid string) error
- func AddPingTask(clients []string, defaultOn bool, name string, target, task_type string, ...) (uint, error)
- func ClearTaskResultsByTimeBefore(before time.Time) error
- func CreateTask(taskId string, clients []string, command string) error
- func DeleteAllPingRecords() error
- func DeletePingRecords(id []uint) error
- func DeletePingTask(id []uint) error
- func EditPingTask(tasks []*models.PingTask) error
- func GetAllPingTasks() ([]models.PingTask, error)
- func GetAllTasks() ([]models.Task, error)
- func GetPingRecords(uuid string, taskId int, start, end time.Time) ([]models.PingRecord, error)
- func GetPingRecordsBatch(uuids []string, taskId int, start, end time.Time) (map[string][]models.PingRecord, error)
- func GetPingTasksByClient(uuid string) []models.PingTask
- func GetSpecificTaskResult(taskId, clientId string) (*models.TaskResult, error)
- func GetTaskByTaskId(taskId string) (*models.Task, error)
- func GetTaskResultsByTaskId(taskId string) ([]models.TaskResult, error)
- func GetTasksByClientId(clientId string) ([]models.Task, error)
- func ReloadPingSchedule() error
- func SavePingRecord(record models.PingRecord) error
- func SaveTaskResult(taskId, clientId, result string, exitCode int, timestamp time.Time) error
- func UpdatePingTaskOrder(order map[uint]int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultOnClientUUID ¶
AddDefaultOnClientUUID 在新客户端注册后,把该 UUID 追加到所有 default_on=true 的任务的 clients 中(去重)。
func AddPingTask ¶
func AddPingTask(clients []string, defaultOn bool, name string, target, task_type string, interval int, reference string) (uint, error)
AddPingTask 创建延迟监测任务。defaultOn 表示新加入的服务器是否自动开启此监测。
func DeleteAllPingRecords ¶
func DeleteAllPingRecords() error
func DeletePingRecords ¶
func DeletePingTask ¶
func GetAllPingTasks ¶
func GetAllTasks ¶
func GetPingRecords ¶
func GetPingRecordsBatch ¶ added in v0.1.16
func GetPingRecordsBatch(uuids []string, taskId int, start, end time.Time) (map[string][]models.PingRecord, error)
GetPingRecordsBatch 一次查询取回多个节点的 ping 记录(见 metricstore 里的说明)。
func GetPingTasksByClient ¶
GetPingTasksByClient 获取指定服务器需要执行的延迟监测任务。
func GetSpecificTaskResult ¶
func GetSpecificTaskResult(taskId, clientId string) (*models.TaskResult, error)
func GetTaskResultsByTaskId ¶
func GetTaskResultsByTaskId(taskId string) ([]models.TaskResult, error)
func ReloadPingSchedule ¶
func ReloadPingSchedule() error
func SavePingRecord ¶
func SavePingRecord(record models.PingRecord) error
func SaveTaskResult ¶
func UpdatePingTaskOrder ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.