// StartCapture returns a started capture. StopCapture should be called on
// complete.
capture := &Capture{recordings: make(CaptureSnapshot)}
c.capturesLock.Lock()
defer c.capturesLock.Unlock()
c.captures[capture] = struct{}{}
c.captureCount.Add(1)
return capture
}
// StopCapture stops capturing metrics for the given capture instance.