Documentation
¶
Index ¶
- Constants
- Variables
- func DecCountOfRunningGoRoutine()
- func IncCountOfRunningGoRoutine()
- func IncCountOfTask()
- func IncCountOfTaskError()
- func IncCountOfTaskFinished()
- func NewStatus(id, status, info string, updateTime time.Time) *config.Status
- type DmPrometheus
- type Manager
- type Service
- type StatusHelper
- type TaskQueue
Constants ¶
View Source
const ( StatusPrefix = "/hera/dm/status/" TipStatusPending = "Join in queue, wait for execute. My WindowPeriod is %d - %d " TipStatusRunning = "I M Running ~" TipStatusError = "Error Occurred : %s ." TipStatusFinished = "Job Finished at %s " TipStatusStoppedRunning = "Manually stopped when running" TipStatusStoppedPending = "Manually stopped when still pending" StatusPendingError = "Status is pending but could not find it in the taskQueue " StatusCannotStopError = "Status is %s . This status cannot be stopped " )
View Source
const (
StopKeyPrefix = "/hera/dm/stop-job/"
)
Variables ¶
View Source
var CountOfJob = prometheus2.NewCounterVec( prometheus2.CounterOpts{ Name: "dm_task_total_count", Help: "Number of Job", }, []string{}, )
View Source
var CountOfJobError = prometheus2.NewCounterVec( prometheus2.CounterOpts{ Name: "dm_task_error", Help: "Number of Job Occurred Error In Dm", }, []string{}, )
View Source
var CountOfJobFinished = prometheus2.NewCounterVec( prometheus2.CounterOpts{ Name: "dm_task_finished", Help: "Number of Job Finished By Dm", }, []string{}, )
View Source
var CountOfRunningGoRoutine = prometheus2.NewGauge( prometheus2.GaugeOpts{ Name: "dm_go_routine_count", Help: "Number of Go Routine Running", }, )
Functions ¶
func DecCountOfRunningGoRoutine ¶
func DecCountOfRunningGoRoutine()
func IncCountOfRunningGoRoutine ¶
func IncCountOfRunningGoRoutine()
func IncCountOfTask ¶
func IncCountOfTask()
func IncCountOfTaskError ¶
func IncCountOfTaskError()
func IncCountOfTaskFinished ¶
func IncCountOfTaskFinished()
Types ¶
type DmPrometheus ¶
type DmPrometheus struct {
// contains filtered or unexported fields
}
func NewDmPrometheus ¶
func NewDmPrometheus(pc *prometheus.Config, onOff chan bool) *DmPrometheus
func (*DmPrometheus) Run ¶
func (dp *DmPrometheus) Run()
func (*DmPrometheus) Stop ¶
func (dp *DmPrometheus) Stop()
type Manager ¶
type Manager struct {
Controllers map[string]*chan bool
Tasks *TaskQueue
Config *config.Config
CountManager *chan int
StatusHelper *StatusHelper
}
func NewManager ¶
func (*Manager) AddController ¶
type Service ¶
type Service struct {
Job *config.Job
Conf *config.Config
Controller *chan bool
IDType string
Mutex *concurrency.Mutex
StopChan *chan bool
}
func NewService ¶
type StatusHelper ¶
func NewStatusHelper ¶
func NewStatusHelper(cli *clientv3.Client) *StatusHelper
func (*StatusHelper) ReadStatus ¶
func (sh *StatusHelper) ReadStatus(id string) (*config.Status, error)
func (*StatusHelper) WriteStatus ¶
func (sh *StatusHelper) WriteStatus(id, status, info string) error
type TaskQueue ¶
type TaskQueue struct {
// contains filtered or unexported fields
}
func NewTaskQueue ¶
func NewTaskQueue() TaskQueue
func (*TaskQueue) RemoveByID ¶
Click to show internal directories.
Click to hide internal directories.