Exemple #1
0
        private void AddEvent(T @event, StreamCoordinates queryCoordinates)
        {
            var key = settings.KeyProvider(@event);

            if (!windows.ContainsKey(key))
            {
                windows[key] = new Windows <T, TKey>(key, settings);
            }
            if (!windows[key].AddEvent(@event, queryCoordinates) && !restart)
            {
                eventsMetric?.For("dropped").Increment();
            }
        }
        private void AddEvent(T @event, StreamCoordinates queryCoordinates)
        {
            var key = settings.KeyProvider(@event);

            var lag = DateTime.Now - settings.TimestampProvider(@event);

            eventLagMetric.Report(lag);

            if (!windows.ContainsKey(key))
            {
                windows[key] = new Windows <T, TKey>(key, settings);
            }
            if (!windows[key].AddEvent(@event, queryCoordinates) && !restart)
            {
                settings.OnEventDrop?.Invoke(@event);
                eventsMetric?.For("dropped").Increment();
            }
        }