Exemplo n.º 1
0
        /// <summary>
        /// Create a continuous event at a particular frequency, aggregated over a period.
        /// </summary>
        /// <param name="name">The name of the event.</param>
        /// <param name="interval">The interval in which to collect the metric, in seconds.</param>
        /// <param name="period">The aggregation period in seconds.</param>
        /// <param name="collector">A delegate to collect the metric.</param>
        /// <returns>A newly constructed Event instance.</returns>
        public static Event Create(string name, float interval, float period, EventCollectionDelegate collector)
        {
            var e = new Event(name, interval, period, collector);

            AddEvent(e);
            return(e);
        }
Exemplo n.º 2
0
            /// <summary>
            /// Constucts an Event that collects a metric each interval and aggregates over a period.
            /// </summary>
            /// <param name="name">The name of the event.</param>
            /// <param name="interval">The interval in which to collect the metric, in seconds.</param>
            /// <param name="period">The aggregation period in seconds.</param>
            /// <param name="collector">A delegate to collect the metric.</param>
            /// <returns>A newly constructed Event instance.</returns>
            public Event(string name, float interval, float period, EventCollectionDelegate collector)
            {
                this.name = name;
                _interval = interval;
                _period   = period;

                this.collector        = collector;
                this.dispatchDelegate = DefaultDispatchDelegate;
            }