Ejemplo n.º 1
0
        public DiagnoserSessionMinDetails Get(string sessionId, string diagnoser)
        {
            SessionController sessionController = new SessionController();

            ISession session = sessionController.GetSessionWithId(new SessionId(sessionId)).Result;

            IDiagnoserSession diagSession = session.GetDiagnoserSessions().Where(p => p.Diagnoser.Name == diagnoser).First();

            DiagnoserSessionMinDetails retVal = new DiagnoserSessionMinDetails
            {
                Name            = diagSession.Diagnoser.Name,
                CollectorStatus = diagSession.CollectorStatus,
                AnalyzerStatus  = diagSession.AnalyzerStatus,
                Logs            = new List <String>(diagSession.GetLogs().Select(p => p.FileName)),
                Reports         = new List <String>(diagSession.GetReports().Select(p => p.FileName))
            };

            return(retVal);
        }
Ejemplo n.º 2
0
        public DiagnoserSessionDetails Get(string sessionId, string diagnoser, bool detailed)
        {
            SessionController sessionController = new SessionController();

            ISession session = sessionController.GetSessionWithId(new SessionId(sessionId)).Result;

            IDiagnoserSession diagSession = session.GetDiagnoserSessions().Where(p => p.Diagnoser.Name == diagnoser).First();

            DiagnoserSessionDetails retVal = new DiagnoserSessionDetails
            {
                Name            = diagSession.Diagnoser.Name,
                CollectorStatus = diagSession.CollectorStatus,
                AnalyzerStatus  = diagSession.AnalyzerStatus
            };

            foreach (Log log in diagSession.GetLogs())
            {
                LogDetails temp = new LogDetails
                {
                    FileName                 = log.FileName,
                    RelativePath             = log.RelativePath,
                    FullPermanentStoragePath = log.FullPermanentStoragePath,
                    StartTime                = log.StartTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    EndTime = log.EndTime.ToString("yyyy-MM-dd HH:mm:ss")
                };
                retVal.AddLog(temp);
            }
            foreach (Report report in diagSession.GetReports())
            {
                ReportDetails temp = new ReportDetails
                {
                    FileName                 = report.FileName,
                    RelativePath             = report.RelativePath,
                    FullPermanentStoragePath = report.FullPermanentStoragePath
                };
                retVal.AddReport(temp);
            }

            return(retVal);
        }