aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.h
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-02-17 08:20:46 +0000
committerGitHub <[email protected]>2023-02-17 00:20:46 -0800
commit2ec65fd3e171145450416ae76be1a7dd8c646704 (patch)
tree13bdb7e5deb60d4e58be2714cfdcf7f70272bc1e /zenserver/cache/structuredcache.h
parentExperimental ObjectStore/CDN like endpoint (diff)
downloadzen-2ec65fd3e171145450416ae76be1a7dd8c646704.tar.xz
zen-2ec65fd3e171145450416ae76be1a7dd8c646704.zip
Enhanced rpc request recording (#229)
* rpc replay zen command * fix replay sessions for thread * recording start/stop as zen commands * move rpcrecording code to zenutil to remove code duplication * simplify recording http request threading * added more data logging to rpc replay * NotFound is an acceptable response for an rpc request * fix rpc replay command line parsing * rpc replay stats * Allow spawning of sub-process workers when replaying rpc recording * changelog
Diffstat (limited to 'zenserver/cache/structuredcache.h')
-rw-r--r--zenserver/cache/structuredcache.h38
1 files changed, 10 insertions, 28 deletions
diff --git a/zenserver/cache/structuredcache.h b/zenserver/cache/structuredcache.h
index 6a4cedef0..f606a1cf5 100644
--- a/zenserver/cache/structuredcache.h
+++ b/zenserver/cache/structuredcache.h
@@ -28,32 +28,14 @@ class ZenCacheStore;
enum class CachePolicy : uint32_t;
enum class RpcAcceptOptions : uint16_t;
-namespace cache::detail {
- struct RecordBody;
- struct ChunkRequest;
- struct RecordedRequests;
-
- class IRequestRecorder
- {
- public:
- virtual ~IRequestRecorder() {}
- virtual uint64_t IRequestRecorder_RecordRequest(const ZenContentType ContentType, const IoBuffer& RequestBuffer) = 0;
- virtual void IRequestRecorder_RecordResponse(uint64_t RequestIndex,
- const ZenContentType ContentType,
- const IoBuffer& ResponseBuffer) = 0;
- virtual void IRequestRecorder_RecordResponse(uint64_t RequestIndex,
- const ZenContentType ContentType,
- const CompositeBuffer& ResponseBuffer) = 0;
- };
- class IRequestReplayer
- {
- public:
- virtual ~IRequestReplayer() {}
- virtual uint64_t IRequestReplayer_GetRequestCount() const = 0;
- virtual ZenContentType IRequestReplayer_GetRequest(uint64_t RequestIndex, IoBuffer& OutBuffer) = 0;
- virtual ZenContentType IRequestRecorder_GetResponse(uint64_t RequestIndex, IoBuffer& OutBuffer) = 0;
- };
-} // namespace cache::detail
+namespace cache {
+ class IRpcRequestReplayer;
+ class IRpcRequestRecorder;
+ namespace detail {
+ struct RecordBody;
+ struct ChunkRequest;
+ } // namespace detail
+} // namespace cache
/**
* Structured cache service. Imposes constraints on keys, supports blobs and
@@ -185,9 +167,9 @@ private:
metrics::OperationTiming m_UpstreamGetRequestTiming;
CacheStats m_CacheStats;
- void ReplayRequestRecorder(cache::detail::IRequestReplayer& Replayer, uint32_t ThreadCount);
+ void ReplayRequestRecorder(cache::IRpcRequestReplayer& Replayer, uint32_t ThreadCount);
- std::unique_ptr<cache::detail::IRequestRecorder> m_RequestRecorder;
+ std::unique_ptr<cache::IRpcRequestRecorder> m_RequestRecorder;
};
/** Recognize both kBinary and kCompressedBinary as kCompressedBinary for structured cache value keys.