-
Notifications
You must be signed in to change notification settings - Fork 71
/
progress.go
60 lines (48 loc) · 2.02 KB
/
progress.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package ghostferry
import (
"github.com/go-mysql-org/go-mysql/mysql"
)
const (
TableActionWaiting = "waiting"
TableActionCopying = "copying"
TableActionCompleted = "completed"
)
type TableProgress struct {
LastSuccessfulPaginationKey uint64
TargetPaginationKey uint64
CurrentAction string // Possible values are defined via the constants TableAction*
RowsWritten uint64
BatchSize uint64
BytesWritten uint64
}
type Progress struct {
// Possible values are defined in ferry.go
// Shows what the ferry is currently doing in one word.
CurrentState string
// The Payload field of the ProgressCallback config will be copied to here
// verbatim.
// Example usecase: you can be sending all the status to some aggregation
// server and you want some sort of custom identification with this field.
CustomPayload string
Tables map[string]TableProgress
LastSuccessfulBinlogPos mysql.Position
BinlogStreamerLag float64 // This is the amount of seconds the binlog streamer is lagging by (seconds)
BinlogWriterLag float64 // This is the amount of seconds the binlog writer is lagging by (seconds)
Throttled bool
// if the TargetVerifier is enabled, we emit this lag, otherwise this number will be 0
TargetBinlogStreamerLag float64
// The number of data iterators currently active.
ActiveDataIterators int
// The behaviour of Ghostferry varies with respect to the VerifierType.
// For example: a long cutover is OK if
VerifierType string
// The message that the verifier may emit for additional information
VerifierMessage string
// These are some variables that are only filled when CurrentState == done.
FinalBinlogPos mysql.Position
// A best estimate on the speed at which the copying is taking place. If
// there are large gaps in the PaginationKey space, this probably will be inaccurate.
PaginationKeysPerSecond uint64
ETA float64 // seconds
TimeTaken float64 // seconds
}