aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp/servers/httpsys.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2024-12-11 12:58:21 +0100
committerGitHub Enterprise <[email protected]>2024-12-11 12:58:21 +0100
commit376ba6bf28792971275e9f56181f4b5230b05066 (patch)
tree1bda5193721f3a4270d8b4f97da23bd2c29c36fb /src/zenhttp/servers/httpsys.cpp
parentreduce oplog job name (#261) (diff)
downloadzen-376ba6bf28792971275e9f56181f4b5230b05066.tar.xz
zen-376ba6bf28792971275e9f56181f4b5230b05066.zip
Memory tracking improvements (#262)
* added LLM tag to properly tag RPC allocations * annotated some more httpsys functions with memory tags * only emit memory scope events if the active tag is different from the new tag
Diffstat (limited to 'src/zenhttp/servers/httpsys.cpp')
-rw-r--r--src/zenhttp/servers/httpsys.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp
index 9e8044a58..54308a00b 100644
--- a/src/zenhttp/servers/httpsys.cpp
+++ b/src/zenhttp/servers/httpsys.cpp
@@ -845,6 +845,8 @@ HttpAsyncWorkRequest::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTr
void
HttpAsyncWorkRequest::AsyncWorkItem::Execute()
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
ZEN_TRACE_CPU("httpsys::async_execute");
try
@@ -1726,6 +1728,8 @@ HttpSysServerRequest::ReadPayload()
void
HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode)
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
ZEN_ASSERT(IsHandled() == false);
auto Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode);
@@ -1743,6 +1747,8 @@ HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode)
void
HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::span<IoBuffer> Blobs)
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
ZEN_ASSERT(IsHandled() == false);
auto Response = new HttpMessageResponseRequest(m_HttpTx, (uint16_t)ResponseCode, ContentType, Blobs);
@@ -1760,6 +1766,8 @@ HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentTy
void
HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentType ContentType, std::u8string_view ResponseString)
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
ZEN_ASSERT(IsHandled() == false);
auto Response =
@@ -1778,6 +1786,8 @@ HttpSysServerRequest::WriteResponse(HttpResponseCode ResponseCode, HttpContentTy
void
HttpSysServerRequest::WriteResponseAsync(std::function<void(HttpServerRequest&)>&& ContinuationHandler)
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
if (m_HttpTx.Server().IsAsyncResponseEnabled())
{
m_NextCompletionHandler = new HttpAsyncWorkRequest(m_HttpTx, std::move(ContinuationHandler));
@@ -1875,6 +1885,8 @@ InitialRequestHandler::IssueRequest(std::error_code& ErrorCode)
HttpSysRequestHandler*
InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesTransferred)
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
auto _ = MakeGuard([&] { m_IsInitialRequest = false; });
switch (IoResult)
@@ -2085,6 +2097,8 @@ HttpSysServer::RegisterService(HttpService& Service)
Ref<HttpServer>
CreateHttpSysServer(HttpSysConfig Config)
{
+ ZEN_MEMSCOPE(GetHttpsysTag());
+
return Ref<HttpServer>(new HttpSysServer(Config));
}