From 1143af52ae1924b6e2cad347924bad578dda5391 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 10 Apr 2024 13:50:09 +0200 Subject: remote project store stats (#44) * add remote oplog store statistics * block chunking when uploading oplog to zenserver (mirroring) * make sure we can move temporary dechunked file into cas store --- src/zenserver/upstream/upstreamcache.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/zenserver/upstream/upstreamcache.cpp') diff --git a/src/zenserver/upstream/upstreamcache.cpp b/src/zenserver/upstream/upstreamcache.cpp index 6d1d026cc..ab8fe8704 100644 --- a/src/zenserver/upstream/upstreamcache.cpp +++ b/src/zenserver/upstream/upstreamcache.cpp @@ -210,7 +210,8 @@ namespace detail { CacheRecord.IterateAttachments([&](CbFieldView AttachmentHash) { CloudCacheResult AttachmentResult = Session.GetCompressedBlob(BlobStoreNamespace, AttachmentHash.AsHash()); - Result.Bytes += AttachmentResult.Bytes; + Result.ReceivedBytes += AttachmentResult.ReceivedBytes; + Result.SentBytes += AttachmentResult.SentBytes; Result.ElapsedSeconds += AttachmentResult.ElapsedSeconds; Result.ErrorCode = AttachmentResult.ErrorCode; @@ -249,7 +250,8 @@ namespace detail { CacheRecord.IterateAttachments([&](CbFieldView AttachmentHash) { CloudCacheResult AttachmentResult = Session.GetCompressedBlob(BlobStoreNamespace, AttachmentHash.AsHash()); - Result.Bytes += AttachmentResult.Bytes; + Result.ReceivedBytes += AttachmentResult.ReceivedBytes; + Result.SentBytes += AttachmentResult.SentBytes; Result.ElapsedSeconds += AttachmentResult.ElapsedSeconds; Result.ErrorCode = AttachmentResult.ErrorCode; @@ -283,7 +285,9 @@ namespace detail { if (Result.ErrorCode == 0) { - return {.Status = {.Bytes = Result.Bytes, .ElapsedSeconds = Result.ElapsedSeconds, .Success = Result.Success}, + return {.Status = {.Bytes = gsl::narrow(Result.ReceivedBytes), + .ElapsedSeconds = Result.ElapsedSeconds, + .Success = Result.Success}, .Value = Result.Response, .Source = &m_Info}; } @@ -379,7 +383,9 @@ namespace detail { if (Result.ErrorCode == 0) { - return {.Status = {.Bytes = Result.Bytes, .ElapsedSeconds = Result.ElapsedSeconds, .Success = Result.Success}, + return {.Status = {.Bytes = gsl::narrow(Result.ReceivedBytes), + .ElapsedSeconds = Result.ElapsedSeconds, + .Success = Result.Success}, .Value = Result.Response, .Source = &m_Info}; } @@ -555,7 +561,7 @@ namespace detail { m_Status.SetFromErrorCode(Result.ErrorCode, Result.Reason); return {.Reason = std::move(Result.Reason), - .Bytes = Result.Bytes, + .Bytes = gsl::narrow(Result.ReceivedBytes), .ElapsedSeconds = Result.ElapsedSeconds, .Success = Result.Success}; } @@ -629,7 +635,7 @@ namespace detail { static void AppendResult(const CloudCacheResult& Result, GetUpstreamCacheResult& Out) { Out.Success &= Result.Success; - Out.Bytes += Result.Bytes; + Out.Bytes += gsl::narrow(Result.ReceivedBytes); Out.ElapsedSeconds += Result.ElapsedSeconds; if (Result.ErrorCode) @@ -673,7 +679,7 @@ namespace detail { return false; } - TotalBytes += BlobResult.Bytes; + TotalBytes += gsl::narrow(BlobResult.ReceivedBytes); TotalElapsedSeconds += BlobResult.ElapsedSeconds; } @@ -694,7 +700,7 @@ namespace detail { .Success = false}; } - TotalBytes += RefResult.Bytes; + TotalBytes += gsl::narrow(RefResult.ReceivedBytes); TotalElapsedSeconds += RefResult.ElapsedSeconds; std::string Reason; @@ -746,7 +752,7 @@ namespace detail { } } - TotalBytes += FinalizeResult.Bytes; + TotalBytes += gsl::narrow(FinalizeResult.ReceivedBytes); TotalElapsedSeconds += FinalizeResult.ElapsedSeconds; return {.Bytes = TotalBytes, .ElapsedSeconds = TotalElapsedSeconds, .Success = true}; -- cgit v1.2.3