diff --git a/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs b/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs index 243c5ad1..95e9282c 100644 --- a/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs +++ b/implement/PersistentProcess/PersistentProcess.WebHost/StartupAdminInterface.cs @@ -543,14 +543,22 @@ TruncateProcessHistoryReport truncateProcessHistory(TimeSpan productionBlockDura lock (avoidConcurrencyLock) { + var storeReductionStopwatch = System.Diagnostics.Stopwatch.StartNew(); + publicAppHost?.processVolatileRepresentation?.StoreReductionRecordForCurrentState(processStoreWriter); + storeReductionStopwatch.Stop(); + + var getFilesForRestoreStopwatch = System.Diagnostics.Stopwatch.StartNew(); + var filesForRestore = PersistentProcess.PersistentProcessVolatileRepresentation.GetFilesForRestoreProcess( processStoreFileStore).files .Select(filePathAndContent => filePathAndContent.Key) .ToImmutableHashSet(EnumerableExtension.EqualityComparer()); + getFilesForRestoreStopwatch.Stop(); + var deleteFilesStopwatch = System.Diagnostics.Stopwatch.StartNew(); int deletedFilesCount = 0; @@ -573,6 +581,8 @@ TruncateProcessHistoryReport truncateProcessHistory(TimeSpan productionBlockDura { beginTime = beginTime, deletedFilesCount = deletedFilesCount, + storeReductionTimeSpentMilli = (int)storeReductionStopwatch.ElapsedMilliseconds, + getFilesForRestoreTimeSpentMilli = (int)getFilesForRestoreStopwatch.ElapsedMilliseconds, deleteFilesTimeSpentMilli = (int)deleteFilesStopwatch.ElapsedMilliseconds, totalTimeSpentMilli = (int)totalStopwatch.ElapsedMilliseconds, }; @@ -724,6 +734,10 @@ public class TruncateProcessHistoryReport public int totalTimeSpentMilli; + public int storeReductionTimeSpentMilli; + + public int getFilesForRestoreTimeSpentMilli; + public int deleteFilesTimeSpentMilli; } }