Example #1
0
        private DeserializationInfo DeserializeMessage(EventData eventData)
        {
            var            sw   = Stopwatch.StartNew();
            var            type = eventData.GetMessageType();
            Exception      serializationException = null;
            BaseOpenSchema deserialized           = null;

            try
            {
                switch (type)
                {
                case EventProcessorConstants.SerilogEventType:
                    deserialized = GetKustoLog(eventData);
                    break;

                case EventProcessorConstants.RoboCustosInteractionEventType:
                    deserialized = GetKustoInteraction(eventData);
                    break;
                }
            }
            catch (Exception e)
            {
                Log.Error(e, "Error deserializing event data");
                serializationException = e;
            }
            sw.Stop();
            _batchStats.ReportSerialization(sw.ElapsedMilliseconds, serializationException);
            return(new DeserializationInfo(deserialized, type, sw.Elapsed, serializationException));
        }
Example #2
0
 public DeserializationInfo(BaseOpenSchema deserializedEvent, string eventType, TimeSpan elapsedTime, Exception e)
 {
     DeserializedEvent = deserializedEvent;
     EventType         = eventType;
     ElaspsedTime      = elapsedTime;
     Exception         = e;
 }