diff options
| author | Stefan Boberg <[email protected]> | 2023-05-16 13:34:08 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-16 13:34:08 +0200 |
| commit | 4c518511ccf35c79284bde3dd10860b9bb52b6a0 (patch) | |
| tree | 05f58d276ee82564832a2c9c078d3b1b6809d3cb /src/zenhttp/httpclient.cpp | |
| parent | Moved EnableVTMode function into zencore (#311) (diff) | |
| download | zen-4c518511ccf35c79284bde3dd10860b9bb52b6a0.tar.xz zen-4c518511ccf35c79284bde3dd10860b9bb52b6a0.zip | |
Additional trace instrumentation (#312)
* added trace instrumentation to upstreamcache
* added asio trace instrumentation
* added trace annotations for project store
* added trace annotations for BlockStore
* added trace annotations for HttpClient
* added trace annotations for CAS/GC
Diffstat (limited to 'src/zenhttp/httpclient.cpp')
| -rw-r--r-- | src/zenhttp/httpclient.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp index 761b4b08e..05ff6d07b 100644 --- a/src/zenhttp/httpclient.cpp +++ b/src/zenhttp/httpclient.cpp @@ -11,6 +11,7 @@ #include <zencore/sharedbuffer.h> #include <zencore/stream.h> #include <zencore/testing.h> +#include <zencore/trace.h> #include <zenhttp/httpshared.h> ZEN_THIRD_PARTY_INCLUDES_START @@ -186,6 +187,8 @@ HttpClient::~HttpClient() HttpClient::Response HttpClient::TransactPackage(std::string_view Url, CbPackage Package) { + ZEN_TRACE_CPU("HttpClient::TransactPackage"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); // First, list of offered chunks for filtering on the server end @@ -283,6 +286,8 @@ HttpClient::TransactPackage(std::string_view Url, CbPackage Package) HttpClient::Response HttpClient::Put(std::string_view Url, const IoBuffer& Payload) { + ZEN_TRACE_CPU("HttpClient::Put"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); Sess->SetBody(AsCprBody(Payload)); Sess->SetHeader(cpr::Header{{"Content-Type", std::string(MapContentTypeToString(Payload.GetContentType()))}}); @@ -293,6 +298,8 @@ HttpClient::Put(std::string_view Url, const IoBuffer& Payload) HttpClient::Response HttpClient::Get(std::string_view Url) { + ZEN_TRACE_CPU("HttpClient::Get"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); return CommonResponse(Sess->Get()); @@ -301,6 +308,8 @@ HttpClient::Get(std::string_view Url) HttpClient::Response HttpClient::Delete(std::string_view Url) { + ZEN_TRACE_CPU("HttpClient::Delete"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); return CommonResponse(Sess->Delete()); @@ -309,6 +318,8 @@ HttpClient::Delete(std::string_view Url) HttpClient::Response HttpClient::Post(std::string_view Url) { + ZEN_TRACE_CPU("HttpClient::PostNoPayload"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); return CommonResponse(Sess->Post()); } @@ -316,6 +327,8 @@ HttpClient::Post(std::string_view Url) HttpClient::Response HttpClient::Post(std::string_view Url, const IoBuffer& Payload) { + ZEN_TRACE_CPU("HttpClient::PostWithPayload"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); Sess->SetBody(AsCprBody(Payload)); @@ -327,6 +340,8 @@ HttpClient::Post(std::string_view Url, const IoBuffer& Payload) HttpClient::Response HttpClient::Post(std::string_view Url, CbObject Payload) { + ZEN_TRACE_CPU("HttpClient::PostObjectPayload"); + Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); Sess->SetBody(AsCprBody(Payload)); @@ -338,6 +353,8 @@ HttpClient::Post(std::string_view Url, CbObject Payload) HttpClient::Response HttpClient::Post(std::string_view Url, CbPackage Pkg) { + ZEN_TRACE_CPU("HttpClient::PostPackage"); + CompositeBuffer Message = zen::FormatPackageMessageBuffer(Pkg); Impl::Session Sess = m_Impl->AllocSession(m_BaseUri, Url); |