Beispiel #1
0
        /// <summary>
        /// Computes the next lowest date in milliseconds based on a specification and the
        /// from-time passed in.
        /// </summary>
        /// <param name="spec">defines the schedule</param>
        /// <param name="afterTimeInMillis">defines the start time</param>
        /// <param name="timeZone">The time zone.</param>
        /// <param name="timeAbacus">The time abacus.</param>
        /// <returns>
        /// a long date tick value for the next schedule occurance matching the spec
        /// </returns>

        public static long ComputeNextOccurance(
            ScheduleSpec spec,
            long afterTimeInMillis,
            TimeZoneInfo timeZone,
            TimeAbacus timeAbacus)
        {
            if (ExecutionPathDebugLog.IsEnabled && Log.IsDebugEnabled)
            {
                Log.Debug(
                    ".computeNextOccurance Computing next occurance," +
                    "  afterTimeInTicks=" + afterTimeInMillis.TimeFromMillis(timeZone) +
                    "  as long=" + afterTimeInMillis +
                    "  spec=" + spec);
            }

            // Add the minimum resolution to the Start time to ensure we don't get the same exact time
            if (spec.UnitValues.ContainsKey(ScheduleUnit.SECONDS))
            {
                afterTimeInMillis += timeAbacus.GetOneSecond();
            }
            else
            {
                afterTimeInMillis += 60 * timeAbacus.GetOneSecond();
            }

            return(Compute(spec, afterTimeInMillis, timeZone, timeAbacus));
        }
Beispiel #2
0
 public AggregationMethod Make()
 {
     if (_isEver)
     {
         return(new AggregatorRateEver(_intervalTime, _timeAbacus.GetOneSecond(), _timeProvider));
     }
     else
     {
         return(new AggregatorRate(_timeAbacus.GetOneSecond()));
     }
 }