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

Method ReadMaxLoad

go/base/context.go:831–841  ·  view source on GitHub ↗

ReadMaxLoad 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.

(maxLoadList string)

Source from the content-addressed store, hash-verified

829// such as: 'Threads_running=100,Threads_connected=500'
830// It only applies changes in case there's no parsing error.
831func (mctx *MigrationContext) ReadMaxLoad(maxLoadList string) error {
832 loadMap, err := ParseLoadMap(maxLoadList)
833 if err != nil {
834 return err
835 }
836 mctx.throttleMutex.Lock()
837 defer mctx.throttleMutex.Unlock()
838
839 mctx.maxLoad = loadMap
840 return nil
841}
842
843// ReadCriticalLoad parses the `--max-load` flag, which is in multiple key-value format,
844// such as: 'Threads_running=100,Threads_connected=500'

Callers 2

mainFunction · 0.95
applyServerCommandMethod · 0.80

Calls 1

ParseLoadMapFunction · 0.85

Tested by

no test coverage detected