예제 #1
0
        /// <summary>
        /// Logs a warning of the new observed input count is dramatically lower than existing counts
        /// </summary>
        public static void LogForLowObservedInputs(
            LoggingContext loggingContext,
            string pipDescription,
            ObservedInputCounts executionCounts,
            ObservedInputCounts cacheMaxCounts)
        {
            var maxExpected = executionCounts.ComputeMaxExpected();

            if (cacheMaxCounts.AbsentPathProbeCount > maxExpected.AbsentPathProbeCount ||
                cacheMaxCounts.DirectoryEnumerationCount > maxExpected.DirectoryEnumerationCount ||
                cacheMaxCounts.ExistingDirectoryProbeCount > maxExpected.ExistingDirectoryProbeCount ||
                cacheMaxCounts.FileContentReadCount > maxExpected.FileContentReadCount ||
                cacheMaxCounts.ExistingFileProbeCount > maxExpected.ExistingFileProbeCount)
            {
                Logger.Log.UnexpectedlySmallObservedInputCount(
                    loggingContext,
                    pipDescription,
                    cacheMaxCounts.AbsentPathProbeCount,
                    cacheMaxCounts.DirectoryEnumerationCount,
                    cacheMaxCounts.ExistingDirectoryProbeCount,
                    cacheMaxCounts.FileContentReadCount,
                    executionCounts.AbsentPathProbeCount,
                    executionCounts.DirectoryEnumerationCount,
                    executionCounts.ExistingDirectoryProbeCount,
                    executionCounts.FileContentReadCount,
                    executionCounts.ExistingFileProbeCount);
            }
        }
예제 #2
0
 /// <summary>
 /// Returns an object that is the max of the returned items
 /// </summary>
 public ObservedInputCounts Max(ObservedInputCounts other)
 {
     return(other.Sum > Sum ? other : this);
 }