MCPcopy
hub / github.com/github/gh-ost / ReadCriticalLoad

Method ReadCriticalLoad

go/base/context.go:846–856  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

844// such as: 'Threads_running=100,Threads_connected=500'
845// It only applies changes in case there's no parsing error.
846func (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
858func (mctx *MigrationContext) GetControlReplicasLagResult() mysql.ReplicationLagResult {
859 mctx.throttleMutex.Lock()

Callers 2

mainFunction · 0.95
applyServerCommandMethod · 0.80

Calls 1

ParseLoadMapFunction · 0.85

Tested by

no test coverage detected