예제 #1
0
        public StepTracking Clone()
        {
            StepTracking clone = new StepTracking();

            base.Copy(clone);
            clone.count = new AtomicLong(count.Get());
            clone.total = total;
            return(clone);
        }
예제 #2
0
 /// <summary>Returns a counter associated with the specified phase and step.</summary>
 /// <remarks>
 /// Returns a counter associated with the specified phase and step.  Typical
 /// usage is to increment a counter within a tight loop.  Callers may use this
 /// method to obtain a counter once and then increment that instance repeatedly
 /// within a loop.  This prevents redundant lookup operations and object
 /// creation within the tight loop.  Incrementing the counter is an atomic
 /// operation, so there is no risk of lost updates even if multiple threads
 /// increment the same counter.
 /// </remarks>
 /// <param name="phase">Phase to get</param>
 /// <param name="step">Step to get</param>
 /// <returns>Counter associated with phase and step</returns>
 public virtual StartupProgress.Counter GetCounter(Phase phase, Step step)
 {
     if (!IsComplete())
     {
         StepTracking tracking = LazyInitStep(phase, step);
         return(new _Counter_154(tracking));
     }
     else
     {
         return(new _Counter_161());
     }
 }
예제 #3
0
 public _Counter_154(StepTracking tracking)
 {
     this.tracking = tracking;
 }
예제 #4
0
        /// <summary>Returns the counter value for the specified phase and step.</summary>
        /// <param name="phase">Phase to get</param>
        /// <param name="step">Step to get</param>
        /// <returns>long counter value for phase and step</returns>
        public virtual long GetCount(Phase phase, Step step)
        {
            StepTracking tracking = GetStepTracking(phase, step);

            return(tracking != null?tracking.count.Get() : 0);
        }
예제 #5
0
        /// <summary>Returns the total for the specified phase and step.</summary>
        /// <param name="phase">Phase to get</param>
        /// <param name="step">Step to get</param>
        /// <returns>long total</returns>
        public virtual long GetTotal(Phase phase, Step step)
        {
            StepTracking tracking = GetStepTracking(phase, step);

            return(tracking != null && tracking.total != long.MinValue ? tracking.total : 0);
        }