forked from Shopify/ghostferry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress.go
47 lines (38 loc) · 1.46 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
package ghostferry
import (
"github.com/siddontang/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*
}
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 // seconds
Throttled bool
// The behaviour of Ghostferry varies with respect to the VerifierType.
// For example: a long cutover is OK if
VerifierType 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
}