MCPcopy Create free account
hub / github.com/devfeel/dottask / defaultLogCounterInfo

Method defaultLogCounterInfo

tasks.go:370–382  ·  view source on GitHub ↗
(ctx *TaskContext)

Source from the content-addressed store, hash-verified

368}
369
370func (service *TaskService) defaultLogCounterInfo(ctx *TaskContext) error {
371 showInfos := []*ShowCountInfo{}
372 for _, t := range service.GetAllTasks() {
373 //service.Logger().Debug(t.TaskID(), " Start:", t.CounterInfo().StartTime.Format(fullTimeLayout), " RUN:", t.CounterInfo().RunCounter.Count(), " ERROR:", t.CounterInfo().ErrorCounter.Count())
374 showInfos = append(showInfos, &ShowCountInfo{TaskID: t.TaskID(), Lable: "RUN", Count: t.CounterInfo().RunCounter.Count()})
375 showInfos = append(showInfos, &ShowCountInfo{TaskID: t.TaskID(), Lable: "ERROR", Count: t.CounterInfo().ErrorCounter.Count()})
376 }
377 if len(showInfos) > 0 {
378 str, _ := json.Marshal(showInfos)
379 service.Logger().Debug(string(str))
380 }
381 return nil
382}
383
384// ValidateTaskType validate the TaskType is supported
385func ValidateTaskType(taskType string) bool {

Callers

nothing calls this directly

Calls 6

GetAllTasksMethod · 0.95
LoggerMethod · 0.95
TaskIDMethod · 0.65
CountMethod · 0.65
CounterInfoMethod · 0.65
DebugMethod · 0.65

Tested by

no test coverage detected