aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcachestore.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-12-15 20:12:41 +0100
committerPer Larsson <[email protected]>2021-12-15 20:12:41 +0100
commit9313768464789551f287304eadb2fb3f139cdf18 (patch)
tree2e0da7e5ac6217b0d587b297f2827fede4379b7c /zenserver/cache/structuredcachestore.cpp
parentUpdated readme. (diff)
downloadzen-9313768464789551f287304eadb2fb3f139cdf18.tar.xz
zen-9313768464789551f287304eadb2fb3f139cdf18.zip
Added trace scopes.
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
-rw-r--r--zenserver/cache/structuredcachestore.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index 8f1754346..a1a30e4af 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -18,6 +18,7 @@
#include <zencore/testutils.h>
#include <zencore/thread.h>
#include <zencore/timer.h>
+#include <zencore/trace.h>
#include <zenstore/cidstore.h>
#if ZEN_PLATFORM_WINDOWS
@@ -82,6 +83,8 @@ ZenCacheStore::~ZenCacheStore()
bool
ZenCacheStore::Get(std::string_view InBucket, const IoHash& HashKey, ZenCacheValue& OutValue)
{
+ ZEN_TRACE_CPU("Z$::Get");
+
bool Ok = m_MemLayer.Get(InBucket, HashKey, OutValue);
#if ZEN_USE_CACHE_TRACKER
@@ -118,6 +121,8 @@ ZenCacheStore::Get(std::string_view InBucket, const IoHash& HashKey, ZenCacheVal
void
ZenCacheStore::Put(std::string_view InBucket, const IoHash& HashKey, const ZenCacheValue& Value)
{
+ ZEN_TRACE_CPU("Z$::Put");
+
// Store value and index
ZEN_ASSERT(Value.Value.Size());
@@ -745,6 +750,8 @@ ZenCacheDiskLayer::CacheBucket::Scrub(ScrubContext& Ctx)
void
ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx)
{
+ ZEN_TRACE_CPU("Z$::DiskLayer::CacheBucket::GatherReferences");
+
const GcClock::TimePoint ExpireTime =
GcCtx.MaxCacheDuration() == GcClock::Duration::max() ? GcClock::TimePoint::min() : GcCtx.Time() - GcCtx.MaxCacheDuration();
@@ -805,6 +812,8 @@ ZenCacheDiskLayer::CacheBucket::GatherReferences(GcContext& GcCtx)
void
ZenCacheDiskLayer::CacheBucket::CollectGarbage(GcContext& GcCtx)
{
+ ZEN_TRACE_CPU("Z$::DiskLayer::CacheBucket::CollectGarbage");
+
Flush();
RwLock::ExclusiveLockScope _(m_IndexLock);