Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/24/14 09:16:42 (10 years ago)
Author:
mroscoe
Message:
 
Location:
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3
Files:
158 added
6 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/AdminHelper.cshtml

    r11030 r11222  
    1818 *@
    1919
    20 @helper UserList(string destinationTag, string url, bool multiline) {
     20@helper UserList(string destinationTag, string url, bool multiline)
     21{
    2122  <script>
    2223    $.ajax({
    2324      url: "@(new HtmlString(url))", datatype: "json", success: function (result) {
    2425        $("#" + "@destinationTag").html("");
    25         @if(multiline) {
     26        @if (multiline)
     27        {
    2628          @:$("#" + "@destinationTag").attr("size", result.length);
    2729        }
    28         else {
     30        else
     31        {
    2932          @:$("#" + "@destinationTag").append("<option></option>");
    3033        }
     
    3942@helper UserTaskStats(string destinationTag, string url, string userName, string start, string end)
    4043{
    41   if (userName != "" || userName != null) {
     44  if (userName != "" || userName != null)
     45  {
    4246    <text>
    4347      $.ajax({
     
    5862  }
    5963}
     64
     65@helper MoreTaskInfo(string url)
     66{
     67  <text>
     68    function MoreTaskInfo(caller) {
     69      if($(caller).siblings('.moreInfoTable').length == 0) {
     70        var taskId = $(caller).attr('id');
     71        $.ajax({
     72          url: "@(new HtmlString(url))?taskId=" + taskId, datatype: "json", success: function (result) {
     73            var appendString = '<table class="moreInfoTable"><tr>';
     74            for (var i = 0; i < result.length; i++) {
     75              if(i % 2 == 0 && i != 0) {
     76                appendString += '</tr><tr>';
     77              }
     78              appendString += '<td class="taskInfoCell"><label class="taskInfoKey">' + result[i].Key + '</label>';
     79              appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed(4) + '</label></td>';
     80            }
     81            appendString += '</tr></table>'
     82            $(caller).parent().append(appendString);
     83          }
     84        });
     85        $(caller).html("Less Info");
     86      }
     87      else {
     88        $(caller).siblings('.moreInfoTable').remove();
     89        $(caller).html("More Info");
     90      }
     91    }
     92  </text>
     93}
     94
     95@helper MoreSlaveInfo(string url)
     96{
     97  <text>
     98    function MoreSlaveInfo(caller) {
     99      if($(caller).siblings('.moreInfoTable').length == 0) {
     100        var slaveId = $(caller).attr('id');
     101        $.ajax({
     102          url: "@(new HtmlString(url))?slaveId=" + slaveId, datatype: "json", success: function (result) {
     103            var appendString = '<table class="moreInfoTable"><tr>';
     104            for (var i = 0; i < result[0].length; i++) {
     105              appendString += '<th class="slaveInfoHeader">' + result[0][i].Key + '</th>'
     106            }
     107            appendString += '</tr>';
     108            for (var j = 0; j < result.length; j++) {
     109              appendString += '<tr>';
     110              for (var k = 0; k < result[j].length; k++) {
     111                appendString += '<td class="slaveInfoCell"><label class="slaveInfoValue">' + result[j][k].Value + '</label></td>';
     112              }
     113              appendString += '</tr>';
     114            }
     115            appendString += '</table>'
     116            $(caller).parent().append(appendString);
     117          }
     118        });
     119        $(caller).html("Less Info");
     120      }
     121      else {
     122        $(caller).siblings('.moreInfoTable').remove();
     123        $(caller).html("More Info");
     124      }
     125    }
     126  </text>
     127}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml

    r11196 r11222  
    250250        $("#@(destinationTag)").find(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','none');
    251251
     252        //Set variable for tracking jobId and open first job grouping
     253        var currentJob = result[0].JobId;
     254        $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[0].JobId + '"><h1>' + result[0].JobName + '</h1></section>');
     255
    252256        //For each result create a seperate collapsable section with a chart and info label
    253257        for(var i = 0; i < result.length; i++){
    254           $("#" + "@(destinationTag)").append(
     258          if(currentJob != result[i].JobId) {
     259            $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[i].JobId + '"><h1>' + result[i].JobName + '</h1></section>');
     260            currentJob = result[i].JobId;
     261          }
     262          $("#" + currentJob).append(
    255263            '<section class="chartContainer">' +
    256               '<h1 class="title" id="@(destinationTag)' + result[i].Key + 'PlotTitle">Task ' + result[i].Key + '</h1>' +
     264              '<h1 class="title" id="@(destinationTag)' + result[i].TaskId + 'PlotTitle">Task ' + result[i].TaskId + '</h1>' +
    257265              '<button class="collapse" onclick="CollapseSection(this)">+</button>' +
    258266              '<div id="@(destinationTag)Plot' + i + '"></div>' +
    259267              '<label id="@(destinationTag)PlotInfo' + i + '"></label>' +
     268              '<a id="' + result[i].TaskId + '" class="moreInfo" onclick="MoreTaskInfo(this)">More Info</a>' +
    260269            '</section>'
    261270          )
     
    263272          //those of errors
    264273          $(".errorTask","#" + "@(destinationTag)").each(function() {
    265             if($(this).html()==result[i].Key) {
    266               $("#@(destinationTag)" + result[i].Key + "PlotTitle").css("color","red");
    267               $("#@(destinationTag)" + result[i].Key + "PlotTitle").append(" - ERROR");
     274            if($(this).html()==result[i].TaskId) {
     275              $("#@(destinationTag)" + result[i].TaskId + "PlotTitle").css("color","red");
     276              $("#@(destinationTag)" + result[i].TaskId + "PlotTitle").append(" - ERROR");
    268277              $(".errorContainer, .errorTitle, .underline","#@(destinationTag)").css('display','inline-block');
    269278              $(this).css('display','inline-block');
     
    271280            }
    272281          });
    273           waitTime = [result[i].Value[0]];
    274           transferTime = [result[i].Value[1]];
    275           runTime = [result[i].Value[2]];
     282          waitTime = [result[i].TotalWaiting];
     283          transferTime = [result[i].TotalTransfer];
     284          runTime = [result[i].TotalRuntime];
    276285          window["@(destinationTag)Plot" + i] = $.jqplot("@(destinationTag)Plot" + i, [waitTime,transferTime,runTime], {
    277286            seriesDefaults:{
     
    307316            upon data in the label below the chart */
    308317          $("#" + "@(destinationTag)Plot" + i).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
    309             $(this).siblings("label").html(seriesDescriptions[seriesIndex] + ": " + data[1]);
     318            $(this).next("label").html(seriesDescriptions[seriesIndex] + ": " + data[1]);
    310319          });
    311320
     
    551560        $('#' + destTag).append(
    552561          '<section class="chartContainer">' +
    553             '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].SlaveID + '</h1>' +
     562            '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].ClientName + '</h1>' +
    554563            '<button class="collapse" onclick="CollapseSection(this)">+</button>' +
    555564            '<div id="' + destTag + slaveChartNames[0] + 'Plot' + i + '"></div>' +
    556565            '<div id="' + destTag + slaveChartNames[1] + 'Plot' + i + '"></div>' +
    557566            '<div id="' + destTag + slaveChartNames[2] + 'Plot' + i + '"></div>' +
     567            '<a id="' + result[i][0].SlaveID + '" class="moreInfo" onclick="MoreSlaveInfo(this)">More Info</a>' +
    558568          '</section>');
    559569        for(j = 0; j < result[i].length; j++) {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ExceptionHelper.cshtml

    r11084 r11222  
    102102        $("#" + "@destinationTag").append(ErrorHTML);
    103103      }
     104      else if("@(destinationTag)" == "ExceptionContainer") {
     105        $("#@(destinationTag)").append(
     106          '<section class="chartContainer">' +
     107            '<h1 class="title">No errors found for the specified filters!</h1>' +
     108          '</section>'
     109        )
     110      }
    104111    }
    105112  });
     
    144151@helper ShowErrors(string destinationTag) {
    145152  <text>
    146   $("#@(destinationTag)").children(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','inline-block');
     153  $("#@(destinationTag)").find(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','inline-block');
    147154  </text>
    148155}
     
    200207            '<button class="collapse" onclick="CollapseSection(this)">+</button>' +
    201208            '<label id="' + result[i][0] + 'ErrorMessage">Error Message: ' + result[i][1] + '</label>' +
    202             '<label id="' + result[i][0] + 'Client">Slave: <a onclick="ShowSlaveInfo(this)">' + result[i][2] + '</a></label>' +
    203             '<label id="' + result[i][0] + 'User">User Name: ' + result[i][3] + '</label>' +
    204             '<label id="' + result[i][0] + 'Date">Date/Time: ' + result[i][4] + '</label>' +
     209            '<label id="' + result[i][0] + 'Client">Slave: <a id="' + result[i][2] + '" onclick="ShowSlaveInfo(this)">' + result[i][3] + '</a></label>' +
     210            '<label id="' + result[i][0] + 'User">User Name: ' + result[i][4] + '</label>' +
     211            '<label id="' + result[i][0] + 'Job">Job Name: ' + result[i][5] + '</label>' +
     212            '<label id="' + result[i][0] + 'Date">Date/Time: ' + result[i][6] + '</label>' +
    205213          '</section>'
    206214        );
     
    229237  //Opens a sub-container with slave information
    230238  function ShowSlaveInfo(caller) {
     239    var taskSlaveId = $(caller).attr('id');
    231240    if($(caller).parent().parent().children(".chartContainer").length == 0) {
    232       @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null,"$(caller).html()")
     241      @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null,"taskSlaveId")
    233242    }
    234243    else {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css

    r11084 r11222  
    535535}
    536536
     537.chartContainer > label:first-of-type, .moreTaskInfo {
     538  margin-bottom: 1%;
     539  display: block;
     540}
     541
     542.chartContainer > label, .moreInfo {
     543  color: #666666;
     544}
     545
     546.moreInfo {
     547  margin-top: 2%;
     548  text-decoration: underline;
     549}
     550
     551.moreInfo:hover {
     552  color: #F7921D;
     553  cursor: pointer;
     554}
     555
     556.moreInfoTable {
     557  width: 96%;
     558  margin: 2% 0% 0% 2%;
     559  -webkit-border-radius: 5px;
     560  -moz-border-radius: 5px;
     561  border-radius: 5px;
     562  border: 1px solid #8297F5;
     563}
     564
     565.taskInfoCell {
     566  width: 50%;
     567  padding-top: 1%;
     568  padding-left: 1%;
     569}
     570
     571.moreInfoTable tr:last-of-type .taskInfoCell {
     572  padding-bottom: 1%;
     573}
     574
     575.moreInfoTable .taskInfoCell:first-of-type {
     576  border-right: 1px solid #8297F5;
     577}
     578
     579.taskInfoKey, .taskInfoValue {
     580  margin: 1% 0% 0% 0%;
     581  display: inline-block;
     582  color: #666666;
     583}
     584
     585.taskInfoKey {
     586  width: 70%;
     587}
     588
     589.taskInfoValue {
     590  width: 28%;
     591  text-align: right;
     592}
     593
     594.jobTaskGroup {
     595  margin: 2% 0% 3% 1%;
     596  -webkit-border-radius: 5px;
     597  -moz-border-radius: 5px;
     598  border-radius: 5px;
     599  border: 2px solid #8297F5;
     600  background-color: #C9DCF0;
     601}
     602
     603.jobTaskGroup > h1{
     604  margin: -1% 30% 0% 1%;
     605  padding: 0.5% 1%;
     606  -webkit-border-radius: 3px;
     607  -moz-border-radius: 3px;
     608  border-radius: 3px;
     609  border: 1px solid #8297F5;
     610  background-color: #FAFAFA;
     611  font-size: 1.6em;
     612  display: block;
     613}
     614
     615.jobTaskGroup section {
     616  background-color: #FAFAFA;
     617}
     618
    537619/* Admin Page Styles */
    538620.usersField .filterChoices {
     
    606688}
    607689
     690#SlavesContainer .chartContainer div:last-of-type {
     691  margin-bottom: 1%;
     692}
     693
     694.slaveInfoHeader, .slaveInfoCell {
     695  width: 16%;
     696}
     697
     698.slaveInfoHeader:first-of-type, .slaveInfoCell:first-of-type {
     699  width: 20%;
     700}
     701
     702.slaveInfoCell {
     703  border-right: 1px solid #8297F5;
     704}
     705
     706.slaveInfoCell:last-of-type {
     707  border-right: none;
     708}
     709
     710.slaveInfoValue {
     711  padding-left: 48%;
     712}
     713
     714.slaveInfoCell:first-of-type .slaveInfoValue {
     715  padding-left: 0%;
     716}
     717
    608718#ExceptionContainer .chartContainer label {
    609719  margin: 1% 0 1% 1%;
     
    614724}
    615725
     726.chartContainer .chartContainer {
     727  font-size: 0.8em;
     728}
     729
    616730.chartContainer .chartContainer h1 {
    617   font-size: 1em;
     731  font-size: 1.6em;
     732}
     733
     734.chartContainer .chartContainer > div {
     735  font-size: 1.3em;
     736  margin-bottom: 2%;
    618737}
    619738
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/AdminDataController.cs

    r11030 r11222  
    2424    }
    2525
    26     public JsonResult TaskStats(DateTime start, DateTime end, string userName=null)
    27     {
    28       using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
    29       {
     26    public JsonResult TaskStats(DateTime start, DateTime end, string userName=null) {
     27      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) {
    3028        var taskStats = (from tasks in db.FactTasks
    3129                        join jobs in db.DimJobs
     
    3533                        (string.IsNullOrEmpty(userName) || jobs.UserName == userName)
    3634                        select new { tasks.TotalWaitingTime, tasks.TotalTransferTime, tasks.TotalRuntime, tasks.NumCalculationRuns,
    37                           tasks.CoresRequired, tasks.MemoryRequired, tasks.TaskSize, tasks.ResultSize})
     35                          tasks.CoresRequired, tasks.MemoryRequired})
    3836                          .ToList();
    3937
     
    4543        FullStats.Add(new KeyValuePair<string, double>("Cores Required", taskStats.Sum(c => c.CoresRequired)));
    4644        FullStats.Add(new KeyValuePair<string, double>("Memory Required", taskStats.Sum(m => m.MemoryRequired)));
    47         FullStats.Add(new KeyValuePair<string, double>("Task Size", taskStats.Sum(ts => ts.TaskSize)));
    48         FullStats.Add(new KeyValuePair<string, double>("Result Size", taskStats.Sum(rs => Convert.ToDouble(rs.ResultSize))));
    4945
    5046        return Json(FullStats, JsonRequestBehavior.AllowGet);
    5147      }
    5248    }
     49
     50    public JsonResult MoreTaskInfo(string taskId) {
     51      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     52      {
     53        var moreInfo = (from tasks in db.FactTasks
     54                         where tasks.TaskId.ToString() == taskId
     55                         select new
     56                         {
     57                           tasks.TotalWaitingTime,
     58                           tasks.TotalTransferTime,
     59                           tasks.TotalRuntime,
     60                           tasks.NumCalculationRuns,
     61                           tasks.CoresRequired,
     62                           tasks.MemoryRequired,
     63                         })
     64                          .ToList();
     65
     66        List<KeyValuePair<string, double>> AllInfo = new List<KeyValuePair<string, double>>();
     67        AllInfo.Add(new KeyValuePair<string, double>("Number Calculation Runs", moreInfo.Sum(n => n.NumCalculationRuns)));
     68        AllInfo.Add(new KeyValuePair<string, double>("Cores Required", moreInfo.Sum(c => c.CoresRequired)));
     69        AllInfo.Add(new KeyValuePair<string, double>("Memory Required", moreInfo.Sum(m => m.MemoryRequired)));
     70
     71        return Json(AllInfo, JsonRequestBehavior.AllowGet);
     72      }
     73    }
     74
     75    public JsonResult MoreSlaveInfo(string slaveId) {
     76      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     77      {
     78        var moreInfo = (from slaves in db.FactClientInfos
     79                        where slaves.ClientId.ToString() == slaveId
     80                        select new
     81                        {
     82                          slaves.Time,
     83                          slaves.TotalTimeIdle,
     84                          slaves.TotalTimeCalculating,
     85                          slaves.TotalTimeTransferring,
     86                          slaves.TotalTimeOffline,
     87                          slaves.TotalTimeUnavailable
     88                        }).ToList();
     89
     90        List<List<KeyValuePair<string, string>>> AllInfo = new List<List<KeyValuePair<string, string>>>();
     91        List<List<KeyValuePair<string, string>>> DistinctInfo = new List<List<KeyValuePair<string, string>>>();
     92        for(var i=0; i < moreInfo.Count; i++) {
     93          List<KeyValuePair<string, string>> newRow = new List<KeyValuePair<string, string>>();
     94          newRow.Add(new KeyValuePair<string, string>("Time", moreInfo.ElementAt(i).Time.ToShortDateString() + " " + moreInfo.ElementAt(i).Time.ToShortTimeString()));
     95          newRow.Add(new KeyValuePair<string, string>("Time Idle", moreInfo.ElementAt(i).TotalTimeIdle.ToString()));
     96          newRow.Add(new KeyValuePair<string, string>("Time Calculating", moreInfo.ElementAt(i).TotalTimeCalculating.ToString()));
     97          newRow.Add(new KeyValuePair<string, string>("Time Transferring", moreInfo.ElementAt(i).TotalTimeTransferring.ToString()));
     98          newRow.Add(new KeyValuePair<string, string>("Time Offline", moreInfo.ElementAt(i).TotalTimeOffline.ToString()));
     99          newRow.Add(new KeyValuePair<string, string>("Time Unavailable", moreInfo.ElementAt(i).TotalTimeUnavailable.ToString()));
     100          AllInfo.Add(newRow);
     101        }
     102
     103        //Ensures that only records with changes in Traffic or Time fields are included
     104        List<KeyValuePair<string, string>> lastRecord = null;
     105        //Initilized to true to ensure first record is automatically included
     106        bool isDistinct = true;
     107        foreach (List<KeyValuePair<string, string>> row in AllInfo) {
     108          //Ignores check for first row
     109          if (lastRecord != null) {
     110            isDistinct = false;
     111            //Cycles through values of current row and lastRecord
     112            for (var j=0; j < row.Count; j++) {
     113              //Disregards time field from distinct checks
     114              if (row.ElementAt(j).Key != "Time") {
     115                //If values differ then row is distinct, break loop
     116                if (row.ElementAt(j).Value != lastRecord.ElementAt(j).Value) {
     117                  isDistinct = true;
     118                  break;
     119                }
     120              }
     121            }
     122          }
     123          lastRecord = row;
     124          if (isDistinct) {
     125            DistinctInfo.Add(row);
     126          }
     127        }
     128
     129        return Json(DistinctInfo, JsonRequestBehavior.AllowGet);
     130      }
     131    }
    53132  }
    54133}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs

    r11084 r11222  
    139139    }
    140140
    141     public JsonResult UserTask(string userName, DateTime? start = null, DateTime? end = null, string jobId = null, string taskState=null)
    142     {
    143       using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
    144       {
    145         TaskState state = GetTaskState(taskState);
     141    public JsonResult UserTask(string userName, DateTime? start = null, DateTime? end = null, string jobId = null, string taskState=null) {
     142      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) {
     143        TaskState? state = GetTaskState(taskState);
     144
    146145        var data =
    147146          (from tasks in db.FactTasks
     
    155154           select new
    156155           {
    157              TaskID = tasks.TaskId,
     156             JobName = jobs.JobName,
     157             JobId = jobs.JobId,
     158             TaskId = tasks.TaskId,
    158159             TotalWaiting = tasks.TotalWaitingTime,
    159160             TotalTransfer = tasks.TotalTransferTime,
     
    162163           }).OrderByDescending(s => s.StartDate).ToList();
    163164
    164         List<KeyValuePair<string, List<double>>> results = new List<KeyValuePair<string, List<double>>>();
    165 
    166         for (int i = 0; i < data.Count; i++) {
    167           results.Add(
    168             new KeyValuePair<string, List<double>>(
    169               data[i].TaskID.ToString(),new List<double>{data[i].TotalWaiting,data[i].TotalTransfer,data[i].TotalRuntime}
    170             ) 
    171           );
    172         }
    173 
    174         return Json(results, JsonRequestBehavior.AllowGet);
     165        return Json(data, JsonRequestBehavior.AllowGet);
    175166      }
    176167    }
     
    184175           join users in db.DimUsers
    185176            on slaves.UserId equals users.UserId
     177           join clients in db.DimClients
     178            on slaves.ClientId equals clients.Id
    186179           where (!start.HasValue || slaves.Time >= start) &&
    187180           (!end.HasValue || slaves.Time < end) &&
     
    190183           select new
    191184           {
     185             ClientName = clients.Name,
    192186             SlaveID = slaves.ClientId,
    193187             Time = slaves.Time,
     
    203197    }
    204198
    205     private static TaskState GetTaskState(string taskState) {
    206       TaskState state = TaskState.Finished;
     199    private static TaskState? GetTaskState(string taskState) {
     200      TaskState? state;
    207201      switch (taskState)
    208202      {
     
    230224        case "Waiting":
    231225          state = TaskState.Waiting;
     226          break;
     227        default :
     228          state = null;
    232229          break;
    233230      }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ExceptionDataController.cs

    r11084 r11222  
    1212    {
    1313      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) {
    14         TaskState state = GetTaskState(taskState);
     14        TaskState? state = GetTaskState(taskState);
    1515        var data =
    1616        (from tasks in db.FactTasks
     
    4747         join jobs in db.DimJobs
    4848           on tasks.JobId equals jobs.JobId
     49         join clients in db.DimClients
     50           on tasks.LastClientId equals clients.Id
    4951         where tasks.Exception != null &&
    5052          !tasks.Exception.Equals(string.Empty) &&
     
    5658           ErrorMessage = tasks.Exception,
    5759           ClientID = tasks.LastClientId,
     60           ClientName = clients.Name,
    5861           UserName = jobs.UserName,
     62           JobName = jobs.JobName,
    5963           StartDate = tasks.StartTime
    6064         }).OrderByDescending(s => s.StartDate).ToList();
     
    6468        for (int i = 0; i < data.Count; i++) {
    6569          results.Add(
    66             new List<string> { data[i].TaskID.ToString(), data[i].ErrorMessage, data[i].ClientID.ToString(), data[i].UserName,
    67               data[i].StartDate.ToString("dd/MM/yyyy HH:mm")}
     70            new List<string> { data[i].TaskID.ToString(), data[i].ErrorMessage, data[i].ClientID.ToString(), data[i].ClientName,
     71              data[i].UserName, data[i].JobName, data[i].StartDate.ToString("dd/MM/yyyy HH:mm")
     72            }
    6873          );
    6974        }
     
    7277    }
    7378
    74     private static TaskState GetTaskState(string taskState) {
    75       TaskState state = TaskState.Finished;
     79    private static TaskState? GetTaskState(string taskState) {
     80      TaskState? state;
    7681      switch (taskState) {
    7782        case "Aborted":
     
    99104          state = TaskState.Waiting;
    100105          break;
     106        default :
     107          state = null;
     108          break;
    101109      }
    102110      return state;
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/LoginRequiredController.cs

    r11053 r11222  
    4242        ViewBag.TaskStates = new SelectList(TaskStateList);
    4343        var SlaveList = (from slave in db.FactClientInfos
    44                          select slave.ClientId.ToString()).Distinct();
    45         ViewBag.Slaves = new SelectList(SlaveList);
     44                         join client in db.DimClients
     45                          on slave.ClientId equals client.Id
     46                         select new {
     47                           SlaveId = slave.ClientId.ToString(),
     48                           ClientName = client.Name
     49                         }).Distinct();
     50        ViewBag.Slaves = new SelectList(SlaveList, "SlaveId", "ClientName");
    4651      }
    4752
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/CollapsingSection.js

    r11084 r11222  
    33$(".collapse").click(function () {
    44  if ($(this).html() == "-") {
    5     $(this).parent().children("canvas, div, fieldset, label").fadeOut();
     5    $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table").fadeOut();
    66    $(this).html("+");
    77  }
    88  else {
    9     $(this).parent().children("canvas, div, fieldset, label").fadeIn();
     9    $(this).parent().children("canvas, div, fieldset, label, .chartContainer, a, table").fadeIn();
    1010    $(this).html("-");
    1111  }
     
    1818  var jqCaller = $(caller);
    1919  if (jqCaller.html() == "-") {
    20     jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeOut();
     20    jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table").fadeOut();
    2121    jqCaller.html("+");
    2222  }
    2323  else {
    24     jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeIn();
     24    jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table").fadeIn();
    2525    jqCaller.html("-");
    2626  }
     
    3030  section */
    3131function CollapsedByDefault(caller) {
    32   $(caller).parent().children("canvas, div, fieldset, label, .chartContainer").hide();
     32  $(caller).parent().children("canvas, div, fieldset, label, .chartContainer, a, table").hide();
    3333}
    3434
     
    3636function OpenOnError(caller) {
    3737  var jqCaller = $(caller);
    38   jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer").fadeIn();
     38  jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, a, table").fadeIn();
    3939  jqCaller.parent().children("button").html("-");
    4040}
     
    4545  var jqCaller = $(caller);
    4646  if (jqCaller.html() == "-") {
    47     jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection").hide();
     47    jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table").hide();
    4848    jqCaller.html("+");
    4949  }
    5050  else {
    51     jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection").show();
     51    jqCaller.parent().children("canvas, div, fieldset, label, .chartContainer, .tabSection, a, table").show();
    5252    jqCaller.html("-");
    5353  }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Scripts/jqPlot/plugins/jqplot.dateAxisRenderer.js

    r9646 r11222  
    33 * Pure JavaScript plotting plugin using jQuery
    44 *
    5  * Version: 1.0.0b2_r1012
     5 * Version: 1.0.8
     6 * Revision: 1250
    67 *
    7  * Copyright (c) 2009-2011 Chris Leonello
     8 * Copyright (c) 2009-2013 Chris Leonello
    89 * jqPlot is currently available for use in all personal or commercial projects
    910 * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
     
    3334     * A plugin for a jqPlot to render an axis as a series of date values.
    3435     * This renderer has no options beyond those supplied by the <Axis> class.
    35      * It supplies it's own tick formatter, so the tickOptions.formatter option
     36     * It supplies its own tick formatter, so the tickOptions.formatter option
    3637     * should not be overridden.
    3738     *
     
    334335        var threshold = 30;
    335336        var insetMult = 1;
     337        var daTickInterval = null;
     338       
     339        // if user specified a tick interval, convert to usable.
     340        if (this.tickInterval != null)
     341        {
     342            // if interval is a number or can be converted to one, use it.
     343            // Assume it is in SECONDS!!!
     344            if (Number(this.tickInterval)) {
     345                daTickInterval = [Number(this.tickInterval), 'seconds'];
     346            }
     347            // else, parse out something we can build from.
     348            else if (typeof this.tickInterval == "string") {
     349                var parts = this.tickInterval.split(' ');
     350                if (parts.length == 1) {
     351                    daTickInterval = [1, parts[0]];
     352                }
     353                else if (parts.length == 2) {
     354                    daTickInterval = [parts[0], parts[1]];
     355                }
     356            }
     357        }
    336358
    337359        var tickInterval = this.tickInterval;
     
    401423        ////////
    402424
     425        // special case when there is only one point, make three tick marks to center the point
     426        else if (this.min == null && this.max == null && db.min == db.max)
     427        {
     428             var onePointOpts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
     429             var delta = 300000;
     430             this.min = db.min - delta;
     431             this.max = db.max + delta;
     432             this.numberTicks = 3;
     433
     434             for(var i=this.min;i<=this.max;i+= delta)
     435             {
     436                 onePointOpts.value = i;
     437
     438                 var t = new this.tickRenderer(onePointOpts);
     439
     440                 if (this._overrideFormatString && this._autoFormatString != '') {
     441                    t.formatString = this._autoFormatString;
     442                 }
     443
     444                 t.showLabel = false;
     445                 t.showMark = false;
     446
     447                 this._ticks.push(t);
     448             }
     449
     450             if(this.showTicks) {
     451                 this._ticks[1].showLabel = true;
     452             }
     453             if(this.showTickMarks) {
     454                 this._ticks[1].showTickMarks = true;
     455             }                   
     456        }
    403457        // if user specified min and max are null, we set those to make best ticks.
    404458        else if (this.min == null && this.max == null) {
     459
    405460            var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
     461
    406462            // want to find a nice interval
    407463            var nttarget,
     
    425481
    426482            // If tickInterval is specified, we'll try to honor it.
    427             // Not gauranteed to get this interval, but we'll get as close as
     483            // Not guaranteed to get this interval, but we'll get as close as
    428484            // we can.
    429485            // tickInterval will be used before numberTicks, that is if
    430486            // both are specified, numberTicks will be ignored.
    431487            else if (this.tickInterval) {
    432                 titarget = this.tickInterval;
     488                titarget = new $.jsDate(0).add(daTickInterval[0], daTickInterval[1]).getTime();
    433489            }
    434490
    435491            // if numberTicks specified, try to honor it.
    436             // Not gauranteed, but will try to get close.
     492            // Not guaranteed, but will try to get close.
    437493            else if (this.numberTicks) {
    438494                nttarget = this.numberTicks;
     
    446502                this._autoFormatString = ret[1];
    447503
    448                 min = Math.floor(min/tempti) * tempti;
    449504                min = new $.jsDate(min);
    450                 min = min.getTime();
     505                min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.getUtcOffset();
    451506
    452507                nttarget = Math.ceil((max - min) / tempti) + 1;
     
    606661            }
    607662           
    608             // if user specified a tick interval, convert to usable.
    609             if (this.tickInterval != null)
    610             {
    611                 // if interval is a number or can be converted to one, use it.
    612                 // Assume it is in SECONDS!!!
    613                 if (Number(this.tickInterval)) {
    614                     this.daTickInterval = [Number(this.tickInterval), 'seconds'];
    615                 }
    616                 // else, parse out something we can build from.
    617                 else if (typeof this.tickInterval == "string") {
    618                     var parts = this.tickInterval.split(' ');
    619                     if (parts.length == 1) {
    620                         this.daTickInterval = [1, parts[0]];
    621                     }
    622                     else if (parts.length == 2) {
    623                         this.daTickInterval = [parts[0], parts[1]];
    624                     }
    625                 }
     663            if (this.tickInterval != null && daTickInterval != null) {
     664                this.daTickInterval = daTickInterval;
    626665            }
    627666           
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/Admin.cshtml

    r11084 r11222  
    8888      <label>Limit</label>
    8989      <select id="SlaveLimit">
    90         <option>10</option>
     90        <option>20</option>
    9191        <option>50</option>
    9292        <option selected="selected">100</option>
     
    122122      <label>Limit</label>
    123123      <select id="ExceptionLimit">
    124         <option>2</option>
     124        <option>20</option>
    125125        <option>50</option>
    126126        <option selected="selected">100</option>
     
    227227    //User Overview
    228228    function RefreshUser() {
    229       selectedUser = $("#UserList").val();
    230       limit = $("#UserLimit").val();
    231       startDate = null;
    232       endDate = null;
    233       jobId = null;
    234       taskState = null;
    235       if ($("[value='UserDate']").is(":checked")) {
    236         startDate = $('#UserStart').val();
    237         endDate = $('#UserEnd').val();
    238       }
    239       if ($("[value='JobName']").is(':checked')) {
    240         jobId = $('#JobNames').val();
    241       }
    242       if ($("[value='TaskState']").is(':checked')) {
    243         taskState = $('#TaskState').val();
    244       }
     229      CheckFilters("User");
    245230      @ExceptionHelper.UserExceptions("TasksContainer", Url.Action("TaskExceptions", "ExceptionData"), "limit", "selectedUser", "startDate", "endDate", "jobId", "taskState")
    246231      @ChartHelper.TasksForUser("TasksContainer",Url.Action("UserTask", "ChartData"), "RefreshUser", "selectedUser", "limit", "startDate", "endDate", "jobId", "taskState", "pageNumber")
     
    254239
    255240    function RefreshTask() {
    256       selectedUser = $("#TaskUserList").val();
    257       startDate = $('#TaskStart').val();
    258       endDate = $('#TaskEnd').val();
     241      CheckFilters("Task");
    259242      @AdminHelper.UserTaskStats("TaskStatsContainer", Url.Action("TaskStats", "AdminData"), "selectedUser", "startDate", "endDate")
    260243    }
     
    262245    //Slave Overview
    263246    function RefreshSlave() {
    264       selectedUser = null;
    265       limit = $("#SlaveLimit").val();
    266       startDate = null;
    267       endDate = null;
    268       if ($("[value='SlaveDate']").is(":checked")) {
    269         startDate = $('#SlaveStart').val();
    270         endDate = $('#SlaveEnd').val();
    271       }
    272       if ($("[value='User']").is(':checked')) {
    273         selectedUser = $('#SlaveUserList').val();
    274       }
     247      CheckFilters("Slave");
    275248      @ChartHelper.SlaveInfoChart("SlavesContainer", Url.Action("SlaveInfo", "ChartData"), "limit", false, "startDate", "endDate", "selectedUser", "RefreshSlave", "pageNumber")
    276249      pageNumber = null;
     
    283256
    284257    function RefreshException() {
    285       selectedSlave = null;
    286       limit = $("#ExceptionLimit").val();
     258      CheckFilters("Exception");
     259      @ExceptionHelper.UserExceptions("ExceptionContainer",Url.Action("TaskExceptions","ExceptionData"),"limit",null,"startDate","endDate",null,null,"selectedSlave")
     260      @ExceptionHelper.ErrorsOnSlaves("ExceptionContainer",Url.Action("SlaveExceptions","ExceptionData"),"limit","startDate","endDate","selectedSlave","RefreshException","pageNumber")
     261    }
     262    @ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo","ChartData"),"limit","startDate","endDate")
     263
     264    //General Chart Methods
     265    function CheckFilters(currentTab) {
    287266      startDate = null;
    288267      endDate = null;
    289       if ($("[value='ExceptionDate']").is(":checked")) {
    290         startDate = $('#ExceptionStart').val();
    291         endDate = $('#ExceptionEnd').val();
     268      switch(currentTab) {
     269        case "User":
     270          selectedUser = $("#UserList").val();
     271          jobId = null;
     272          taskState = null;
     273          limit = $("#UserLimit").val();
     274          if ($("[value='UserDate']").is(":checked")) {
     275            startDate = $('#UserStart').val();
     276            endDate = $('#UserEnd').val();
     277          }
     278          if ($("[value='JobName']").is(':checked')) {
     279            jobId = $('#JobNames').val();
     280          }
     281          if ($("[value='TaskState']").is(':checked')) {
     282            taskState = $('#TaskStates').val();
     283          }
     284          break;
     285        case "Task":
     286          selectedUser = $("#TaskUserList").val();
     287          startDate = $('#TaskStart').val();
     288          endDate = $('#TaskEnd').val();
     289          break;
     290        case "Slave":
     291          selectedUser = null;
     292          limit = $("#SlaveLimit").val();
     293          if ($("[value='SlaveDate']").is(":checked")) {
     294            startDate = $('#SlaveStart').val();
     295            endDate = $('#SlaveEnd').val();
     296          }
     297          if ($("[value='User']").is(':checked')) {
     298            selectedUser = $('#SlaveUserList').val();
     299          }
     300          break;
     301        case "Exception":
     302          selectedSlave = null;
     303          limit = $("#ExceptionLimit").val();
     304          if ($("[value='ExceptionDate']").is(":checked")) {
     305            startDate = $('#ExceptionStart').val();
     306            endDate = $('#ExceptionEnd').val();
     307          }
     308          if ($("[value='ExceptionSlave']").is(':checked')) {
     309            selectedSlave = $('#Slaves').val();
     310          }
    292311      }
    293       if ($("[value='ExceptionSlave']").is(':checked')) {
    294         selectedSlave = $('#Slaves').val();
    295       }
    296       @ExceptionHelper.UserExceptions("ExceptionContainer",Url.Action("TaskExceptions","ExceptionData"),"limit",null,"startDate","endDate",null,null,"selectedSlave")
    297       @ExceptionHelper.ErrorsOnSlaves("ExceptionContainer",Url.Action("SlaveExceptions","ExceptionData"),"limit","startDate","endDate","selectedSlave","RefreshException","pageNumber")
    298     }
    299     @ExceptionHelper.ShowSlaveInfo(Url.Action("SlaveInfo","ChartData"),"limit","startDate","endDate")
    300 
    301     //General Chart Methods
     312    }
     313
    302314    @ChartHelper.ResizeCharts()
    303315    @ExceptionHelper.ScrollToException()
     316    @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo","AdminData"))
     317    @AdminHelper.MoreSlaveInfo(Url.Action("MoreSlaveInfo","AdminData"))
    304318  </script>
    305319}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/UserTask.cshtml

    r11084 r11222  
    127127      }
    128128      if ($("[value='TaskState']").is(':checked')) {
    129         taskState = $('#TaskState').val();
     129        taskState = $('#TaskStates').val();
    130130      }
    131131      @ExceptionHelper.UserExceptions("TasksContainer",Url.Action("TaskExceptions", "ExceptionData"),"limit","userName","startDate","endDate","jobId","taskState")
     
    151151    @ChartHelper.ResizeCharts()
    152152    @ExceptionHelper.ScrollToException()
     153    @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo","AdminData"))
    153154  </script>
    154155}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/packages.config

    r9617 r11222  
    11<?xml version="1.0" encoding="utf-8"?>
    22<packages>
    3   <package id="jqPlot" version="1.0.0" targetFramework="net40" />
    4   <package id="jQuery" version="1.8.2" targetFramework="net40" />
    5   <package id="jQuery.UI.Combined" version="1.8.24" targetFramework="net40" />
    6   <package id="jQuery.Validation" version="1.10.0" targetFramework="net40" />
    7   <package id="Microsoft.AspNet.Mvc" version="4.0.20710.0" targetFramework="net40" />
     3  <package id="Antlr" version="3.4.1.9004" targetFramework="net40" />
     4  <package id="jqPlot" version="1.0.8" targetFramework="net40" />
     5  <package id="jQuery" version="2.1.1" targetFramework="net40" />
     6  <package id="jQuery.UI.Combined" version="1.10.4" targetFramework="net40" />
     7  <package id="jQuery.Validation" version="1.13.0" targetFramework="net40" />
     8  <package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
    89  <package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" targetFramework="net40" />
    910  <package id="Microsoft.AspNet.Razor" version="2.0.20715.0" targetFramework="net40" />
    10   <package id="Microsoft.AspNet.Web.Optimization" version="1.0.0" targetFramework="net40" />
     11  <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net40" />
    1112  <package id="Microsoft.AspNet.WebPages" version="2.0.20710.0" targetFramework="net40" />
    1213  <package id="Microsoft.AspNet.WebPages.Data" version="2.0.20710.0" targetFramework="net40" />
    1314  <package id="Microsoft.AspNet.WebPages.WebData" version="2.0.20710.0" targetFramework="net40" />
    14   <package id="Microsoft.jQuery.Unobtrusive.Ajax" version="2.0.30116.0" targetFramework="net40" />
    15   <package id="Microsoft.jQuery.Unobtrusive.Validation" version="2.0.30116.0" targetFramework="net40" />
     15  <package id="Microsoft.jQuery.Unobtrusive.Ajax" version="3.2.0" targetFramework="net40" />
     16  <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.0" targetFramework="net40" />
    1617  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
    17   <package id="Modernizr" version="2.6.2" targetFramework="net40" />
    18   <package id="WebGrease" version="1.3.0" targetFramework="net40" />
     18  <package id="Modernizr" version="2.7.2" targetFramework="net40" />
     19  <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" />
     20  <package id="WebGrease" version="1.6.0" targetFramework="net40" />
    1921</packages>
Note: See TracChangeset for help on using the changeset viewer.