Beispiel #1
0
        /// <summary>
        /// Processes the event, returning true if it passes the metrics filter
        /// and thus updates a value, or false if it doesn't pass the filter.
        /// </summary>
        /// <param name="evt"></param>
        /// <returns></returns>
        public bool ProcessEvent(MungServerEvent evt)
        {
            lock (Sync) {
                if (!Total.Filter(evt))
                {
                    return(false);
                }
                var at = Metric.Period.StandardizeDate(DateTime.UtcNow);

                var updates = new List <MetricValue>();

                foreach (var filter in FilterBuilder.Filters(evt.Data, Dimensions))
                {
                    Console.WriteLine("Filter: {0}", filter);
                    Dictionary <string, double> values = new Dictionary <string, double>();

                    if (!Aggregates.ContainsKey(filter))
                    {
                        var agg = AggregateFactory.Default.Get(Metric);;
                        Aggregates[filter] = agg;
                    }

                    var value = Aggregates[filter].Accumulate(evt);
                }
            }
            return(true);
        }