1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Add api for tcmalloc

This commit is contained in:
winlin 2020-03-25 17:00:16 +08:00
parent 574ae58adc
commit 35a037cf05
8 changed files with 138 additions and 4 deletions

View file

@ -1014,6 +1014,14 @@ srs_error_t SrsServer::http_handle()
if ((err = http_api_mux->handle("error.srs.com/api/v1/tests/errors", new SrsGoApiError())) != srs_success) {
return srs_error_wrap(err, "handle tests errors for error.srs.com");
}
#ifdef SRS_AUTO_GPERF
// The test api for get tcmalloc stats.
// @see Memory Introspection in https://gperftools.github.io/gperftools/tcmalloc.html
if ((err = http_api_mux->handle("/api/v1/tcmalloc", new SrsGoApiTcmalloc())) != srs_success) {
return srs_error_wrap(err, "handle tests errors");
}
#endif
// TODO: FIXME: for console.
// TODO: FIXME: support reload.