Skip to content

Commit c142c38

Browse files
author
ffffwh
committed
remove job status (stage) in metrics
1 parent c16a1de commit c142c38

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

drivers/mysql/common/models.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ type TaskStatistics struct {
6969
MsgStat gonats.Statistics
7070
BufferStat BufferStat
7171
Stage string
72-
Status string
7372
Timestamp int64
7473
MemoryStat MemoryStat
7574
}

drivers/mysql/handle.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,8 @@ func (h *taskHandle) run(taskConfig *common.DtleTaskConfig, d *Driver) {
169169
}
170170
}
171171
}()
172-
173172
}
174173

175-
176174
func (h *taskHandle) emitStats(ru *common.TaskStatistics) {
177175
const srcFullFactor float32 = 4.5
178176
const dstFullFactor float32 = 5
@@ -204,7 +202,6 @@ func (h *taskHandle) emitStats(ru *common.TaskStatistics) {
204202

205203
metrics.SetGaugeWithLabels([]string{"memory.full_kb_count"}, float32(ru.MemoryStat.Full) / 1024, labels)
206204
metrics.SetGaugeWithLabels([]string{"memory.incr_kb_count"}, float32(ru.MemoryStat.Incr) / 1024, labels)
207-
metrics.SetGaugeWithLabels([]string{"job status ",ru.Status}, float32(1), labels)
208205

209206
if ru.TableStats != nil {
210207
metrics.SetGaugeWithLabels([]string{"table", "insert"}, float32(ru.TableStats.InsertCount), labels)

drivers/mysql/mysql/applier.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ type Applier struct {
8888
storeManager *common.StoreManager
8989
gtidCh chan *common.BinlogCoordinateTx
9090

91-
status string
92-
memory1 *int64
93-
memory2 *int64
94-
event *eventer.Eventer
95-
taskConfig *drivers.TaskConfig
91+
stage string
92+
memory1 *int64
93+
memory2 *int64
94+
event *eventer.Eventer
95+
taskConfig *drivers.TaskConfig
9696
}
9797

9898
func NewApplier(
@@ -268,8 +268,8 @@ func (a *Applier) Run() {
268268

269269
go a.updateGtidLoop()
270270

271-
if a.status != jobFullCopy {
272-
a.status = jobFullCopy
271+
if a.stage != jobFullCopy {
272+
a.stage = jobFullCopy
273273
a.sendEvent(jobFullCopy)
274274
}
275275

@@ -444,8 +444,8 @@ func (a *Applier) subscribeNats() error {
444444
a.gtidCh <- nil // coord == nil is a flag for update/upload gtid
445445

446446
a.mysqlContext.Stage = common.StageSlaveWaitingForWorkersToProcessQueue
447-
if a.status != jobIncrCopy {
448-
a.status = jobIncrCopy
447+
if a.stage != jobIncrCopy {
448+
a.stage = jobIncrCopy
449449
a.sendEvent(jobIncrCopy)
450450
}
451451
close(a.rowCopyComplete)
@@ -892,7 +892,6 @@ func (a *Applier) Stats() (*common.TaskStatistics, error) {
892892
Full: *a.memory1,
893893
Incr: *a.memory2,
894894
},
895-
Status: a.status,
896895
}
897896
if a.natsConn != nil {
898897
taskResUsage.MsgStat = a.natsConn.Statistics

0 commit comments

Comments
 (0)