ReadCriticalLoad parses the `--max-load` flag, which is in multiple key-value format, such as: 'Threads_running=100,Threads_connected=500' It only applies changes in case there's no parsing error.
(criticalLoadList string)
| 844 | // such as: 'Threads_running=100,Threads_connected=500' |
| 845 | // It only applies changes in case there's no parsing error. |
| 846 | func (mctx *MigrationContext) ReadCriticalLoad(criticalLoadList string) error { |
| 847 | loadMap, err := ParseLoadMap(criticalLoadList) |
| 848 | if err != nil { |
| 849 | return err |
| 850 | } |
| 851 | mctx.throttleMutex.Lock() |
| 852 | defer mctx.throttleMutex.Unlock() |
| 853 | |
| 854 | mctx.criticalLoad = loadMap |
| 855 | return nil |
| 856 | } |
| 857 | |
| 858 | func (mctx *MigrationContext) GetControlReplicasLagResult() mysql.ReplicationLagResult { |
| 859 | mctx.throttleMutex.Lock() |
no test coverage detected