@ -136,6 +136,8 @@ func (p *printByTable) AddTask(task TaskStatus) {
|
||||
info := fmt.Sprintf("%s; gap=%s", pTime, gapColor.Sprint(gap))
|
||||
return info
|
||||
}
|
||||
cp := task.GetMinStoreCheckpoint()
|
||||
table.Add("checkpoint[global]", formatTS(cp.TS))
|
||||
p.addCheckpoints(&task, table, formatTS)
|
||||
for store, e := range task.LastErrors {
|
||||
table.Add(fmt.Sprintf("error[store=%d]", store), e.ErrorCode)
|
||||
@ -147,21 +149,15 @@ func (p *printByTable) AddTask(task TaskStatus) {
|
||||
|
||||
func (p *printByTable) addCheckpoints(task *TaskStatus, table *glue.Table, formatTS func(uint64) string) {
|
||||
cp := task.GetMinStoreCheckpoint()
|
||||
items := make([][2]string, 0, len(task.Checkpoints))
|
||||
if cp.Type() != CheckpointTypeGlobal {
|
||||
for _, cp := range task.Checkpoints {
|
||||
switch cp.Type() {
|
||||
case CheckpointTypeStore:
|
||||
items = append(items, [2]string{fmt.Sprintf("checkpoint[store=%d]", cp.ID), formatTS(cp.TS)})
|
||||
table.Add(fmt.Sprintf("checkpoint[store=%d]", cp.ID), formatTS(cp.TS))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
items = append(items, [2]string{"checkpoint[central-global]", formatTS(cp.TS)})
|
||||
}
|
||||
|
||||
for _, item := range items {
|
||||
table.Add(item[0], item[1])
|
||||
}
|
||||
}
|
||||
|
||||
func (p *printByTable) PrintTasks() {
|
||||
|
||||
Reference in New Issue
Block a user