MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / CloseCpuPprofFile

Method CloseCpuPprofFile

rest/server_context.go:151–162  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

149}
150
151func (sc *ServerContext) CloseCpuPprofFile(ctx context.Context) (filename string) {
152 sc.cpuPprofFileMutex.Lock()
153 if sc.cpuPprofFile != nil {
154 filename = sc.cpuPprofFile.Name()
155 }
156 if err := sc.cpuPprofFile.Close(); err != nil {
157 base.WarnfCtx(ctx, "Error closing CPU profile file: %v", err)
158 }
159 sc.cpuPprofFile = nil
160 sc.cpuPprofFileMutex.Unlock()
161 return filename
162}
163
164func NewServerContext(ctx context.Context, config *StartupConfig, persistentConfig bool) *ServerContext {
165

Callers 1

handleProfilingMethod · 0.80

Calls 5

WarnfCtxFunction · 0.92
NameMethod · 0.65
CloseMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected