Пример #1
0
 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();
 }
Пример #2
0
        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);
        }
Пример #3
0
        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();
            }
        }