public VizqlPerformanceEvent(VizqlEvent vizqlEvent) { VizqlSessionId = vizqlEvent.VizqlSessionId; ApacheRequestId = vizqlEvent.ApacheRequestId; ThreadId = vizqlEvent.ThreadId; ProcessId = vizqlEvent.ProcessId; EventTimestamp = vizqlEvent.EventTimestamp; KeyType = vizqlEvent.KeyType; ElapsedSeconds = vizqlEvent.GetElapsedTimeInSeconds(); }
public static VizqlSession AppendEventsForKeyType(VizqlSession session, string keyType, IMongoCollection <BsonDocument> collection) { IEnumerable <BsonDocument> documentList; if (session is VizqlServerSession) { if (!VizqlServerSupportedKeytypes.Contains(keyType)) { return(session); } else { documentList = GetEventsForKeyBySession(session.VizqlSessionId, keyType, collection); } } else if (session is VizqlDesktopSession) { if (!VizqlDesktopSupportedKeytypes.Contains(keyType)) { return(session); } else { VizqlDesktopSession desktopSession = session as VizqlDesktopSession; documentList = GetEventsForKeyByPid(desktopSession.ProcessId, keyType, collection); } } else { throw new Exception("VizqlSession not of type Desktop or Server!"); } foreach (var document in documentList) { try { Object[] args = { document }; Type t = VizqlEventClassesByKeytype[keyType]; VizqlEvent vizqlEvent = (VizqlEvent)Activator.CreateInstance(t, args); session.AppendEvent(vizqlEvent); } catch (Exception ex) { Log.ErrorFormat("Exception processing {0} events on session {1}: {2}", keyType, session.VizqlSessionId, ex); } } return(session); }
public VizqlPerformanceEvent(VizqlEvent vizqlEvent) { VizqlSessionId = vizqlEvent.VizqlSessionId; ApacheRequestId = vizqlEvent.ApacheRequestId; ThreadId = vizqlEvent.ThreadId; ProcessId = vizqlEvent.ProcessId; EventTimestamp = vizqlEvent.EventTimestamp; KeyType = vizqlEvent.KeyType; ElapsedSeconds = vizqlEvent.GetElapsedTimeInSeconds(); Worker = vizqlEvent.Worker; FilePath = vizqlEvent.FilePath; File = vizqlEvent.File; LineNumber = vizqlEvent.LineNumber; if (vizqlEvent.ValuePayload != null) { Value = vizqlEvent.ValuePayload.ToString(); } }