Пример #1
0
            public void Complete(long trivialThreshold, ReportProfileData reportProfileData)
            {
                var completeTicks = Stopwatch.GetTimestamp() - _stopwatchTicks;

                var milliseconds = completeTicks * 1000 / Stopwatch.Frequency;

                if (milliseconds > trivialThreshold)
                {
                    reportProfileData(new Report(_timingId, _startTime, TimeSpan.FromMilliseconds(milliseconds)));
                }
            }
        public static void UseProfile <T>(this IPipeConfigurator <T> configurator, ReportProfileData <T> reportProfileData)
            where T : class, PipeContext
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }
            if (reportProfileData == null)
            {
                throw new ArgumentNullException(nameof(reportProfileData));
            }

            var specification = new ProfilePipeSpecification <T>(reportProfileData, 0);

            configurator.AddPipeSpecification(specification);
        }
Пример #3
0
 public ProfilePipeSpecification(ReportProfileData <T> reportProfileData, long trivialThreshold)
 {
     _reportProfileData = reportProfileData;
     _trivialThreshold  = trivialThreshold;
 }
Пример #4
0
 public ProfileFilter(ReportProfileData reportProfileData, long trivialThreshold)
 {
     _reportProfileData = reportProfileData;
     _trivialThreshold  = trivialThreshold;
 }