aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/compactcas.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-05-16 13:34:08 +0200
committerGitHub <[email protected]>2023-05-16 13:34:08 +0200
commit4c518511ccf35c79284bde3dd10860b9bb52b6a0 (patch)
tree05f58d276ee82564832a2c9c078d3b1b6809d3cb /src/zenstore/compactcas.cpp
parentMoved EnableVTMode function into zencore (#311) (diff)
downloadzen-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/zenstore/compactcas.cpp')
-rw-r--r--src/zenstore/compactcas.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/zenstore/compactcas.cpp b/src/zenstore/compactcas.cpp
index 0f6f011e1..a8a4dc102 100644
--- a/src/zenstore/compactcas.cpp
+++ b/src/zenstore/compactcas.cpp
@@ -10,6 +10,7 @@
#include <zencore/fmtutils.h>
#include <zencore/logging.h>
#include <zencore/scopeguard.h>
+#include <zencore/trace.h>
#include <zenstore/scrubcontext.h>
#include <gsl/gsl-lite.hpp>
@@ -234,6 +235,8 @@ CasContainerStrategy::Flush()
void
CasContainerStrategy::ScrubStorage(ScrubContext& Ctx)
{
+ ZEN_TRACE_CPU("CasContainer::ScrubStorage");
+
ZEN_INFO("scrubbing '{}'", m_BlocksBasePath);
std::vector<IoHash> BadKeys;
@@ -373,6 +376,8 @@ CasContainerStrategy::ScrubStorage(ScrubContext& Ctx)
void
CasContainerStrategy::CollectGarbage(GcContext& GcCtx)
{
+ ZEN_TRACE_CPU("CasContainer::CollectGarbage");
+
// It collects all the blocks that we want to delete chunks from. For each such
// block we keep a list of chunks to retain and a list of chunks to delete.
//
@@ -513,6 +518,8 @@ CasContainerStrategy::StorageSize() const
void
CasContainerStrategy::MakeIndexSnapshot()
{
+ ZEN_TRACE_CPU("CasContainer::MakeIndexSnapshot");
+
uint64_t LogCount = m_CasLog.GetLogCount();
if (m_LogFlushPosition == LogCount)
{
@@ -598,6 +605,8 @@ CasContainerStrategy::MakeIndexSnapshot()
uint64_t
CasContainerStrategy::ReadIndexFile(const std::filesystem::path& IndexPath, uint32_t& OutVersion)
{
+ ZEN_TRACE_CPU("CasContainer::ReadIndexFile");
+
std::vector<CasDiskIndexEntry> Entries;
Stopwatch Timer;
const auto _ = MakeGuard([&] {
@@ -645,6 +654,8 @@ CasContainerStrategy::ReadIndexFile(const std::filesystem::path& IndexPath, uint
uint64_t
CasContainerStrategy::ReadLog(const std::filesystem::path& LogPath, uint64_t SkipEntryCount)
{
+ ZEN_TRACE_CPU("CasContainer::ReadLog");
+
if (!TCasLogFile<CasDiskIndexEntry>::IsValid(LogPath))
{
ZEN_WARN("removing invalid cas log at '{}'", LogPath);
@@ -697,6 +708,8 @@ CasContainerStrategy::ReadLog(const std::filesystem::path& LogPath, uint64_t Ski
void
CasContainerStrategy::OpenContainer(bool IsNewStore)
{
+ ZEN_TRACE_CPU("CasContainer::OpenContainer");
+
// Add .running file and delete on clean on close to detect bad termination
m_LocationMap.clear();