예제 #1
0
        // GET: api/CpuMonitoring/5
        public HttpResponseMessage Get(string sessionId)
        {
            var monitoringController = new MonitoringSessionController();

            try
            {
                var session = monitoringController.GetSession(sessionId);
                return(Request.CreateResponse(HttpStatusCode.OK, session));
            }
            catch (Exception ex)
            {
                Logger.LogCpuMonitoringErrorEvent("Controller API Failure - GetSessionId", ex, string.Empty);
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message));
            }
        }
예제 #2
0
        public HttpResponseMessage Analyze(string sessionId)
        {
            var monitoringController = new MonitoringSessionController();
            var session = monitoringController.GetSession(sessionId);

            try
            {
                var result = monitoringController.AnalyzeSession(sessionId, session.BlobSasUri);
                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
            catch (Exception ex)
            {
                Logger.LogCpuMonitoringErrorEvent("Controller API Failure - Analyze", ex, string.Empty);
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message));
            }
        }