MCPcopy
hub / github.com/keploy/keploy / applyPausedState

Function applyPausedState

pkg/agent/memoryguard/memoryguard.go:246–263  ·  view source on GitHub ↗
(paused bool)

Source from the content-addressed store, hash-verified

244}
245
246func applyPausedState(paused bool) {
247 recordingPaused.Store(paused)
248 // Global manager: the buffering manager in single-app mode.
249 if mgr := syncMock.Get(); mgr != nil {
250 mgr.SetMemoryPressure(paused)
251 }
252 // Fan out to registered managers (multi-app: one per app). The global
253 // trigger stays global; only the action reaches every live buffer.
254 pressureHookMu.RLock()
255 hooks := make([]func(paused bool), 0, len(pressureHooks))
256 for _, fn := range pressureHooks {
257 hooks = append(hooks, fn)
258 }
259 pressureHookMu.RUnlock()
260 for _, fn := range hooks {
261 fn(paused)
262 }
263}
264
265// readMemoryCurrent reads the raw cgroup memory.current value (total bytes
266// including page cache). Callers that need the working-set should use

Callers 5

enterPressureMethod · 0.85
resetPressureMethod · 0.85
resetAllPressureFunction · 0.85

Calls 3

GetFunction · 0.92
SetMemoryPressureMethod · 0.80
StoreMethod · 0.45