MCPcopy Create free account
hub / github.com/apache/mesos / downloadRawProfile

Method downloadRawProfile

3rdparty/libprocess/src/memory_profiler.cpp:787–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785
786
787Future<http::Response> MemoryProfiler::downloadRawProfile(
788 const http::Request& request,
789 const Option<http::authentication::Principal>&)
790{
791 Result<time_t> requestedId = extractIdFromRequest(request);
792
793 // Verify that `id` has the correct version if it was explicitly passed.
794 if (requestedId.isError()) {
795 return http::BadRequest(
796 "Invalid parameter 'id': " + requestedId.error() + ".\n");
797 }
798
799 if (currentRun.isSome() && !requestedId.isSome()) {
800 return http::BadRequest(
801 "A profiling run is currently in progress. To download results of the"
802 " previous run, please pass an 'id' explicitly.\n");
803 }
804
805 if (rawProfile.isError()) {
806 return http::BadRequest(
807 "Cannot access raw profile: " + rawProfile.error() + ".\n");
808 }
809
810 // Only requests for the latest available version are allowed.
811 if (requestedId.isSome() &&
812 (requestedId.get() != rawProfile->getId())) {
813 return http::BadRequest(
814 "Cannot serve requested id #" + stringify(requestedId.get()) + ".\n");
815 }
816
817 return rawProfile->asHttp();
818}
819
820
821Future<http::Response> MemoryProfiler::downloadSymbolizedProfile(

Callers

nothing calls this directly

Calls 9

extractIdFromRequestFunction · 0.85
BadRequestClass · 0.85
getIdMethod · 0.80
asHttpMethod · 0.80
errorMethod · 0.65
stringifyClass · 0.50
isErrorMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected