Example #1
0
        //
        // GET: /Diagnostic/

        public ActionResult Index(PeriodParams FromBeforePeriod)
        {
            PeriodParams       per = new PeriodParams();
            List <RequestUser> lst = new List <RequestUser>();

            lst = per.getResponcesFromTimePeriod(null).ToList();
            ViewBag.collectionvalues = lst;

            JavaScriptSerializer serializer = new JavaScriptSerializer();

            ViewData["responcecollection"] = serializer.Serialize(lst);
            RequestUsrViewModel usrmodel = new RequestUsrViewModel();

            usrmodel.MinResponce     = lst.OrderBy(r => r.ResponceTime).First();
            usrmodel.MaxResponce     = lst.OrderByDescending(r => r.ResponceTime).First();
            usrmodel.TopSlowestPages = lst.OrderByDescending(r => r.ResponceTime).Take(10);
            return(View(usrmodel));
        }
Example #2
0
        public PartialViewResult GetData(string period)
        {
            RequestUsrViewModel usrmodel = new RequestUsrViewModel();

            if (Request.IsAjaxRequest())
            {
                PeriodParams parameter = new PeriodParams();
                var          data      = parameter.getResponcesFromTimePeriod(period);
                ViewBag.collectionvalues = data;
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                ViewData["responcecollection"] = serializer.Serialize(data);
                usrmodel.MinResponce           = data.OrderBy(r => r.ResponceTime).First();
                usrmodel.MaxResponce           = data.OrderByDescending(r => r.ResponceTime).First();
                usrmodel.TopSlowestPages       = parameter.getResponcesFromTimePeriod(period).OrderByDescending(r => r.ResponceTime).Take(10);
            }


            return(PartialView("RenderChartAndTablePartial", usrmodel));
        }