Ejemplo n.º 1
0
        // Token: 0x060001B7 RID: 439 RVA: 0x00006AE0 File Offset: 0x00004CE0
        public TResult RunOperation <TResult>(Func <TResult> operation, object debugInfo)
        {
            Stopwatch stopwatch = Stopwatch.StartNew();
            TResult   result;

            try
            {
                result = operation();
            }
            finally
            {
                stopwatch.Stop();
                if (this.slowOperationThreshold < stopwatch.Elapsed)
                {
                    this.logger.Log(MigrationEventType.Error, "SLOW Operation: took {0}s using '{1}' stack trace {2}", new object[]
                    {
                        stopwatch.Elapsed.Seconds,
                        debugInfo,
                        AnchorUtil.GetCurrentStackTrace()
                    });
                }
                else
                {
                    this.logger.Log(MigrationEventType.Instrumentation, "Operation: took {0} using '{1}'", new object[]
                    {
                        stopwatch.Elapsed,
                        debugInfo
                    });
                }
            }
            return(result);
        }