示例#1
0
 public void LogPoint(PerformancePoint point)
 {
     lock (_dataPoints)
     {
         _dataPoints.Add(point);
     }
 }
示例#2
0
        public static PerformancePoint Start(string name)
        {
            var perfPoint = new PerformancePoint {
                Name = name
            };

            perfPoint.StartTimer();
            return(perfPoint);
        }
示例#3
0
        public void LogEnd(string name)
        {
            if (!_currentLogs.ContainsKey(name))
            {
                throw KrakenException.Create("Attempt to LogEnd('{0}') when one has not been started", name);
            }

            PerformancePoint point = _currentLogs[name];

            point.StopTimer();

            // clear the tracker
            _currentLogs.Remove(name);
            LogPoint(point);
            _mostRecentLogName = null;
        }
示例#4
0
        public void LogBegin(string name)
        {
            PerformancePoint point = new PerformancePoint();

            point.Name = name;
            point.StartTimer();

            // Violate bracing rules for coverage
            if (_currentLogs.ContainsKey(name))
            {
                throw KrakenException.Create("Attempt to LogBegin('{0}') when there is already one in progress. Use RequireExplicitLogEnd=false if you are lazy.", name);
            }


            SequentialModeCleanup();

            _currentLogs.Add(name, point);
            _mostRecentLogName = name;
        }