MCPcopy Create free account
hub / github.com/3rdparty/libprocess / stop

Method stop

src/profiler.cpp:106–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106Future<http::Response> Profiler::stop(
107 const http::Request& request,
108 const Option<http::authentication::Principal>&)
109{
110#ifdef ENABLE_GPERFTOOLS
111 if (!started) {
112 return http::BadRequest("Profiler not running.\n");
113 }
114
115 LOG(INFO) << "Stopping Profiler";
116
117 ProfilerStop();
118
119 http::OK response;
120 response.type = response.PATH;
121 response.path = "perftools.out";
122 response.headers["Content-Type"] = "application/octet-stream";
123 response.headers["Content-Disposition"] =
124 strings::format("attachment; filename=%s", PROFILE_FILE).get();
125
126 started = false;
127 return response;
128#else
129 return http::BadRequest(
130 "Perftools is disabled. To enable perftools, "
131 "configure libprocess with --enable-perftools.\n");
132#endif
133}
134
135} // namespace process {

Callers

nothing calls this directly

Calls 2

BadRequestClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected