diff options
| author | Dan Engelbrecht <[email protected]> | 2024-04-10 13:50:09 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-04-10 13:50:09 +0200 |
| commit | 1143af52ae1924b6e2cad347924bad578dda5391 (patch) | |
| tree | 3caa74260f0ef753c4b0da4bf17153d0017e6b2c /src/zenserver/upstream/upstreamcache.cpp | |
| parent | changelog (diff) | |
| download | zen-1143af52ae1924b6e2cad347924bad578dda5391.tar.xz zen-1143af52ae1924b6e2cad347924bad578dda5391.zip | |
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
Diffstat (limited to 'src/zenserver/upstream/upstreamcache.cpp')
| -rw-r--r-- | src/zenserver/upstream/upstreamcache.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
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<int64_t>(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<int64_t>(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<int64_t>(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<int64_t>(Result.ReceivedBytes); Out.ElapsedSeconds += Result.ElapsedSeconds; if (Result.ErrorCode) @@ -673,7 +679,7 @@ namespace detail { return false; } - TotalBytes += BlobResult.Bytes; + TotalBytes += gsl::narrow<int64_t>(BlobResult.ReceivedBytes); TotalElapsedSeconds += BlobResult.ElapsedSeconds; } @@ -694,7 +700,7 @@ namespace detail { .Success = false}; } - TotalBytes += RefResult.Bytes; + TotalBytes += gsl::narrow<int64_t>(RefResult.ReceivedBytes); TotalElapsedSeconds += RefResult.ElapsedSeconds; std::string Reason; @@ -746,7 +752,7 @@ namespace detail { } } - TotalBytes += FinalizeResult.Bytes; + TotalBytes += gsl::narrow<int64_t>(FinalizeResult.ReceivedBytes); TotalElapsedSeconds += FinalizeResult.ElapsedSeconds; return {.Bytes = TotalBytes, .ElapsedSeconds = TotalElapsedSeconds, .Success = true}; |