Example #1
0
        /// <summary>
        /// Creates a new SqlTiming to profile 'command'.
        /// </summary>
        public MongoTiming(string collectionName, string command, ExecuteType type, MiniProfiler profiler)
        {
            Id = Guid.NewGuid();

            CollectionName = collectionName;
            CommandString = command;
            ExecuteType = type;

            if (!MiniProfiler.Settings.ExcludeStackTraceSnippetFromSqlTimings)
                StackTraceSnippet = Helpers.StackTraceSnippet.Get();

            _profiler = profiler;
            if (_profiler != null)
            {
                _profiler.AddMongoTiming(this);
                _startTicks = _profiler.ElapsedTicks;
                StartMilliseconds = _profiler.GetRoundedMilliseconds(_startTicks);
            }
        }