Update email and formating.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Caching;
|
||||
using System.Web.Mvc;
|
||||
using Hangfire;
|
||||
using LeafWeb.Core.Entities;
|
||||
@@ -15,6 +17,8 @@ namespace LeafWeb.WebCms.Controllers
|
||||
[MemberAuthorize]
|
||||
public class QueueController : BaseController
|
||||
{
|
||||
private const int TimeSamples = 40;
|
||||
|
||||
public ActionResult Index(string query)
|
||||
{
|
||||
var resultItems =
|
||||
@@ -34,9 +38,7 @@ namespace LeafWeb.WebCms.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
// completed leaf input for computing runtime statistics
|
||||
var completedLeafInput = DataService.GetLeafInputRecentlyCompleted(100);
|
||||
var timeInProgressEstimater = new TimeInProgressEstimater(completedLeafInput);
|
||||
var timeInProgressEstimater = TimeInProgressEstimater();
|
||||
|
||||
var serviceDescription = ServiceDescription();
|
||||
|
||||
@@ -49,10 +51,24 @@ namespace LeafWeb.WebCms.Controllers
|
||||
return View(queueViewModel);
|
||||
}
|
||||
|
||||
private TimeInProgressEstimater TimeInProgressEstimater()
|
||||
{
|
||||
var estimater = HttpRuntime.Cache["TimeInProgressEstimater"];
|
||||
if (estimater == null)
|
||||
{
|
||||
// completed leaf input for computing runtime statistics
|
||||
var completedLeafInput = DataService.GetLeafInputRecentlyCompleted(TimeSamples);
|
||||
estimater = new TimeInProgressEstimater(completedLeafInput);
|
||||
HttpRuntime.Cache.Insert("TimeInProgressEstimater", estimater, null, DateTime.Now.AddHours(12), Cache.NoSlidingExpiration);
|
||||
}
|
||||
|
||||
return (TimeInProgressEstimater)estimater;
|
||||
}
|
||||
|
||||
public ActionResult LeafInputStatistics()
|
||||
{
|
||||
var data =
|
||||
from li in DataService.GetLeafInputRecentlyCompleted(100)
|
||||
from li in DataService.GetLeafInputRecentlyCompleted(TimeSamples)
|
||||
select $"{li.InputFiles.Count}, {li.TimeInProgress.TotalSeconds}";
|
||||
return Content(string.Join("<br />", data));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user