Exemplo n.º 1
0
        public string GetResolverLag()
        {
            string blobName;
            string date = String.Format("{0:yyyy-MM-dd}", DateTimeUtility.GetPacificTimeNow());

            blobName = "ResolverLag" + date + ".json";
            Dictionary <string, string> ResolverDict = BlobStorageService.GetDictFromBlob(blobName);
            List <TimeSpan>             timeStamps   = new List <TimeSpan>();

            if (ResolverDict != null && ResolverDict.Count > 0)
            {
                foreach (KeyValuePair <string, string> entry in ResolverDict)
                {
                    DateTime time = DateTime.Parse(string.Format("{0:HH:mm}", entry.Key));
                    timeStamps.Add(time.TimeOfDay);
                }

                string latest = timeStamps.Max().Hours + ":" + timeStamps.Max().Minutes;
                double value  = Double.Parse(ResolverDict[latest.ToString()]);
                long   lag    = Convert.ToInt64(value);
                return("Lag: " + lag);
            }

            else
            {
                return("Lag: N/A");
            }
        }
Exemplo n.º 2
0
 public ActionResult DBConnectionsThisWeek()
 {
     string[] blobNames = new string[8];
     for (int i = 0; i < 8; i++)
     {
         blobNames[i] = "DBConnections" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow().AddDays(-i));
     }
     return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName(blobNames, "DBConnections", 50, 600)));
 }
 public ActionResult UsersThiSWeek()
 {
     string[] blobNames = new string[4];
     for (int i = 0; i < 4; i++)
     {
         blobNames[i] = "Users" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow().AddDays(-i)) + "HourlyReport";
     }
     return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName(blobNames, "UsersPerHour", 24, 800)));
 }
Exemplo n.º 4
0
        public ActionResult LatencyReport()
        {
            string today = String.Format("{0:yyyy-MM-dd}", DateTimeUtility.GetPacificTimeNow());

            string[] blobNames = new string[3];
            blobNames[0] = "UploadPackageTimeElapsed" + today;
            blobNames[1] = "SearchPackageTimeElapsed" + today;
            blobNames[2] = "DownloadPackageTimeElapsed" + today;
            return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName(blobNames, "LatencyInMilliseconds", 3, 800)));
        }
Exemplo n.º 5
0
        public ActionResult AverageLatencyTrendThisWeek()
        {
            List <string> value = new List <string>();
            Dictionary <string, List <object> >     time      = new Dictionary <string, List <object> >();
            List <DotNet.Highcharts.Options.Series> seriesSet = new List <DotNet.Highcharts.Options.Series>();
            DateTime start = DateTimeUtility.GetPacificTimeNow().AddDays(-8);

            for (int i = 0; i < 8; i++)
            {
                string date = string.Format("{0:yyyy-MM-dd}", start.AddDays(i));
                List <Tuple <string, long, long, long> > scenarios = GetLatencyData(date);
                value.Add(string.Format("{0:yyyy-MM-dd}", start.AddDays(i)));
                for (int j = 0; j < scenarios.Count; j++)
                {
                    if (time.ContainsKey(scenarios[j].Item1))
                    {
                        time[scenarios[j].Item1].Add(scenarios[j].Item2.ToString());
                    }

                    else
                    {
                        List <object> Yvalue = new List <object>();
                        Yvalue.Add(scenarios[j].Item2.ToString());
                        time.Add(scenarios[j].Item1, Yvalue);
                    }
                }
            }

            foreach (KeyValuePair <string, List <object> > each in time)
            {
                seriesSet.Add(new DotNet.Highcharts.Options.Series
                {
                    Data = new Data(each.Value.ToArray()),
                    Name = each.Key.Replace(" ", "_")
                });
            }

            DotNet.Highcharts.Highcharts chart = ChartingUtilities.GetLineChart(seriesSet, value, "WeeklyAvgLatencyTrend", 500);
            return(PartialView("~/Views/Shared/PartialChart.cshtml", chart));
        }
Exemplo n.º 6
0
        public ActionResult MemUsage()
        {
            string[] blobNames = new string[1];
            blobNames[0] = "nuget-prod-0-search" + @"\Memory\Available MBytes" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow());

            return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName(blobNames, "Memory_Usage_todayInMB", 24 * 4, 800)));
        }
Exemplo n.º 7
0
        public ActionResult CpuUsage()
        {
            string[] blobNames = new string[1];
            blobNames[0] = "nuget-prod-0-search" + @"\Processor(_Total)\% Processor Time" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow());

            return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName(blobNames, "CpuUsagetoday", 24 * 4, 800)));
        }
Exemplo n.º 8
0
 public ActionResult DBConnections()
 {
     return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName("DBConnections" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()), "DBConnections", 12)));
 }
Exemplo n.º 9
0
        /// <summary>
        /// Returns the active requests taken during the last snapshot
        /// </summary>
        /// <param name="hour"></param>
        /// <returns></returns>
        public ActionResult DBRequestsSummary()
        {
            Dictionary <string, string> dict           = BlobStorageService.GetDictFromBlob("DBRequestDetails" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()) + ".json");
            List <DatabaseRequest>      listOfRequests = new List <DatabaseRequest>();

            if (dict != null && dict.Count > 0)
            {
                listOfRequests = new JavaScriptSerializer().Deserialize <List <DatabaseRequest> >(dict.Values.ElementAt(dict.Count - 1));
            }
            return(PartialView("~/Views/Database/DBRequestsSummary.cshtml", listOfRequests));
        }
Exemplo n.º 10
0
        public JsonResult GetHourlyInstanceCount()
        {
            //TBD: Need to take the service name from the config.
            Dictionary <string, string> dict = BlobStorageService.GetDictFromBlob("nuget-prod-0-v2galleryInstanceCount" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()) + "HourlyReport.json");

            if (dict != null && dict.Count > 0)
            {
                return(Json(dict.Values.ElementAt(dict.Count - 1), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("N/A"));
            }
        }
        public JsonResult GetHourlyUsertatus()
        {
            Dictionary <string, string> dict = BlobStorageService.GetDictFromBlob("Users" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()) + "HourlyReport.json");

            if (dict != null && dict.Count > 0)
            {
                //find the sum of values of each hour from today's report.
                int sum = 0;
                foreach (KeyValuePair <string, string> pair in dict)
                {
                    int count = Convert.ToInt32(pair.Value);
                    sum = sum + count;
                }
                return(Json(sum.ToString(), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("N/A"));
            }
        }
Exemplo n.º 12
0
        public ActionResult LatencyToday()
        {
            List <Tuple <string, long, long, long> > scenarios = GetLatencyData(String.Format("{0:yyyy-MM-dd}", DateTimeUtility.GetPacificTimeNow()));

            ViewBag.catalog  = GetCatalogLag();
            ViewBag.resolver = GetResolverLag();
            return(PartialView("~/Views/V2GalleryFrontEnd/V2GalleryFrontEnd_LatencyDetails.cshtml", scenarios));
        }
Exemplo n.º 13
0
        public ActionResult RequestsToday()
        {
            List <Tuple <string, string, string, double> > scenarios = GetRequestsData(String.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()));

            return(PartialView("~/Views/V2GalleryFrontEnd/V2GalleryFrontEnd_RequestDetails.cshtml", scenarios));
        }
Exemplo n.º 14
0
 public ActionResult Throughput()
 {
     return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName("IISRequests" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()), "RequestsPerHour")));
 }
Exemplo n.º 15
0
 public ActionResult ErrorRate()
 {
     return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName("ErrorRate" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()), "ErrorsPerHour")));
 }
Exemplo n.º 16
0
        public JsonResult GetCurrentIndexingStatus()
        {
            Dictionary <string, string> dict = BlobStorageService.GetDictFromBlob("IndexingDiffCount" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow()) + "HourlyReport.json");

            if (dict != null && dict.Count > 0)
            {
                return(Json(dict.Values.ElementAt(dict.Count - 1), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("N/A"));
            }
        }
 public JsonResult GetCurrentPacificTime()
 {
     //Returns the current pacific time. The dates in the charts are all in local time (pacific time) as of now. Hence displayed a clock with pacific time in the home page for reference.
     return(Json(string.Format("{0:HH:mm:ss}", DateTimeUtility.GetPacificTimeNow()), JsonRequestBehavior.AllowGet));
 }
 public ActionResult PackageRestoreThisWeek()
 {
     string[] blobNames = new string[8];
     for (int i = 0; i < 8; i++)
     {
         blobNames[i] = "package.restore.download" + string.Format("{0:MMdd}", DateTimeUtility.GetPacificTimeNow().AddDays(-i)) + "DetailedReport";
     }
     return(PartialView("~/Views/Shared/PartialChart.cshtml", ChartingUtilities.GetLineChartFromBlobName(blobNames, "PackageRestoreThisWeek", 24, 800)));
 }