public void SendActionTelemetry(ActionTelemetryRecord actionTelemetry)
 {
     if (actionTelemetry is IDedupRecord dedupRecord)
     {
         lock (_lock)
         {
             var uploadStats = dedupRecord.UploadStatistics;
             if (uploadStats != null)
             {
                 this._chunksUploaded               += uploadStats.ChunksUploaded;
                 this._compressionBytesSaved        += uploadStats.CompressionBytesSaved;
                 this._dedupUploadBytesSaved        += uploadStats.DedupUploadBytesSaved;
                 this._logicalContentBytesUploaded  += uploadStats.LogicalContentBytesUploaded;
                 this._physicalContentBytesUploaded += uploadStats.PhysicalContentBytesUploaded;
                 this._totalNumberOfChunks          += uploadStats.TotalNumberOfChunks;
             }
             var downloadStats = dedupRecord.DownloadStatistics;
             if (downloadStats != null)
             {
                 this._chunksDownloaded               += downloadStats.ChunksDownloaded;
                 this._compressionBytesSavedDown      += downloadStats.CompressionBytesSaved;
                 this._dedupDownloadBytesSaved        += downloadStats.DedupDownloadBytesSaved;
                 this._totalBytesDown                 += downloadStats.TotalContentBytes;
                 this._physicalContentBytesDownloaded += downloadStats.PhysicalContentBytesDownloaded;
             }
         }
     }
 }
Пример #2
0
        public void SendActionTelemetry(ActionTelemetryRecord actionTelemetry)
        {
            CheckStarted();

            if (sendThrows)
            {
                throw new ApplicationException(nameof(SendActionTelemetry));
            }

            AddRecord(actionTelemetry);
        }