예제 #1
0
        private void StopAPICalls()
        {
            if (!IsAPICallRunning)
            {
                return;
            }

            using (var apiCallClient = new ApiCallClient())
            {
                apiCallClient.Stop();
            }

            //telemetry.StopWriteLog();
            //ptLogAnalizer.StopWriteLog();
        }
예제 #2
0
        private void RunAPICalls(int unitsTotal, int lineAmmount, int apiCallInterval)
        {
            if (IsAPICallRunning)
            {
                return;
            }
            using (var apiCallClient = new ApiCallClient())
            {
                //if (apiCallClient.IsRunning())
                //throw new Exception("API Calls are Running");

                //telemetry.WriteLog();
                //ptLogAnalizer.WriteLog(DateTime.Now, PTLogAnalizer.MonitoredScope.Error | PTLogAnalizer.MonitoredScope.Info);

                var performanceTestExecutionId = apiCallClient.Run(unitsTotal, lineAmmount, apiCallInterval);
                Session["performanceTestExecutionId"] = performanceTestExecutionId;
            }
        }
예제 #3
0
        //public ActionResult YourPartial(YourModel model) //that's if you need the model
        //public ActionResult YourPartial() //that's if you need the model
        //public ActionResult GetData(FlyDataModel flyData) //that's if you need the model
        public ActionResult FlyDataPartial(FlyDataModel flyData)
        {
            TelemetryMain telemetry;

            using (var apiCallClient = new ApiCallClient())
            {
                telemetry = apiCallClient.GetTelemetry();
            }

            //return View(model);
            if (Session["performanceTestExecutionId"] != null)
            {
                var         performanceTestExecutionId = Convert.ToInt32(Session["performanceTestExecutionId"]);
                ApiCallMain mainReport;

                using (var apiCallClient = new ApiCallClient())
                {
                    mainReport = apiCallClient.GetMainReport(performanceTestExecutionId);
                }

                //TODO: fix it
                return(View(new FlyDataModel()
                {
                    CpuUsage = telemetry.CpuUsage,
                    AvailableRAM = telemetry.AvailableRAM,
                    ShowApiCallDetails = true,
                    TotalUnitsExecuted = mainReport.TotalUnitsExecuted,
                    ApiCallAverageTime = mainReport.ApiCallAverageTime.TotalSeconds > 0 ? mainReport.ApiCallAverageTime.TotalSeconds : 0,
                    UnitProcessingAverageTime = mainReport.UnitProcessingAverageTime.TotalSeconds > 0 && mainReport.UnitProcessingAverageTime.TotalSeconds < 1000 ? mainReport.UnitProcessingAverageTime.TotalSeconds : 0
                }));
            }
            else
            {
                return(View(new FlyDataModel()
                {
                    ShowApiCallDetails = false,
                    CpuUsage = telemetry.CpuUsage,
                    AvailableRAM = telemetry.AvailableRAM
                }));
            }
        }