コード例 #1
0
ファイル: SqlProfiler.cs プロジェクト: jmaucher/SStack
        /// <summary>
        /// Tracks when 'command' is started.
        /// </summary>
        public void ExecuteStartImpl(DbCommand command, ExecuteType type)
        {
            var id        = Tuple.Create((object)command, type);
            var sqlTiming = new SqlTiming(command, type, Profiler);

            _inProgress[id] = sqlTiming;
        }
コード例 #2
0
ファイル: SqlProfiler.cs プロジェクト: jmaucher/SStack
        /// <summary>
        /// Tracks when 'command' is started.
        /// </summary>
        public void ExecuteStartImpl(DbCommand command, ExecuteType type)
        {
            var id = Tuple.Create((object)command, type);
            var sqlTiming = new SqlTiming(command, type, Profiler);

            _inProgress[id] = sqlTiming;
        }
コード例 #3
0
ファイル: Timing.cs プロジェクト: jmaucher/SStack
        /// <summary>
        /// Adds the parameter 'sqlTiming' to this Timing's SqlTimings collection.
        /// </summary>
        /// <param name="sqlTiming">A sql statement profiling that was executed in this Timing step.</param>
        /// <remarks>
        /// Used outside this assembly for custom deserialization when creating an <see cref="IStorage"/> implementation.
        /// </remarks>
        public void AddSqlTiming(SqlTiming sqlTiming)
        {
            if (SqlTimings == null)
            {
                SqlTimings = new List <SqlTiming>();
            }

            SqlTimings.Add(sqlTiming);
            sqlTiming.ParentTiming = this;
        }
コード例 #4
0
        /// <summary>
        /// Adds <paramref name="stats"/> to the current <see cref="Timing"/>.
        /// </summary>
        internal void AddSqlTiming(SqlTiming stats)
        {
            if (Head == null)
            {
                return;
            }

            int count;

            stats.IsDuplicate = _sqlExecutionCounts.TryGetValue(stats.CommandString, out count);
            _sqlExecutionCounts[stats.CommandString] = count + 1;

            HasSqlTimings = true;
            if (stats.IsDuplicate)
            {
                HasDuplicateSqlTimings = true;
            }

            Head.AddSqlTiming(stats);
        }
コード例 #5
0
        /// <summary>
        /// Adds <paramref name="stats"/> to the current <see cref="Timing"/>.
        /// </summary>
        internal void AddSqlTiming(SqlTiming stats)
        {
            if (Head == null)
                return;

            int count;

            stats.IsDuplicate = _sqlExecutionCounts.TryGetValue(stats.CommandString, out count);
            _sqlExecutionCounts[stats.CommandString] = count + 1;

            HasSqlTimings = true;
            if (stats.IsDuplicate)
            {
                HasDuplicateSqlTimings = true;
            }

            Head.AddSqlTiming(stats);
        }
コード例 #6
0
ファイル: Timing.cs プロジェクト: jmaucher/SStack
        /// <summary>
        /// Adds the parameter 'sqlTiming' to this Timing's SqlTimings collection.
        /// </summary>
        /// <param name="sqlTiming">A sql statement profiling that was executed in this Timing step.</param>
        /// <remarks>
        /// Used outside this assembly for custom deserialization when creating an <see cref="IStorage"/> implementation.
        /// </remarks>
        public void AddSqlTiming(SqlTiming sqlTiming)
        {
            if (SqlTimings == null)
                SqlTimings = new List<SqlTiming>();

            SqlTimings.Add(sqlTiming);
            sqlTiming.ParentTiming = this;
        }