/// <summary>
        /// Tracks when 'command' is started.
        /// </summary>
        public Guid ExecuteStartImpl(string collectionName, object query, ExecuteType type)
        {
            var id = Guid.NewGuid();
            var mongoTiming = new MongoTiming(collectionName, query.ToString(), type, Profiler);

            _inProgress[id] = mongoTiming;
            return id;
        }
        public Guid ExecuteStartImpl(string collectionName, object query, IMongoUpdate update, ExecuteType type)
        {
            var id = Guid.NewGuid();
            var q = String.Format("{0}\n{1}", query, update);
            var mongoTiming = new MongoTiming(collectionName, q, type, Profiler);

            _inProgress[id] = mongoTiming;
            return id;
        }
        internal void AddMongoTiming(MongoTiming stats)
        {
            if (Head == null)
                return;

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

            HasMongoTimings = true;
            if (stats.IsDuplicate)
            {
                HasDuplicateMongoTimings = true;
            }
            Head.AddMongoTiming(stats);
        }
Exemple #4
0
        internal void AddMongoTiming(MongoTiming mongoTiming)
        {
            if (MongoTimings == null)
                MongoTimings = new List<MongoTiming>();

            MongoTimings.Add(mongoTiming);
            mongoTiming.ParentTiming = this;
        }