Changeset 11246


Ignore:
Timestamp:
07/30/14 16:41:08 (8 years ago)
Author:
mroscoe
Message:
 
Location:
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3
Files:
12 edited

Legend:

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

    r11222 r11246  
    5050            url: "@(new HtmlString(url))?start=" + @start + "&end=" + @end + "&userName=" + @userName, datatype: "json", success: function (userResult) {
    5151              $("#" + "@destinationTag").html("");
     52              var appendUnits;
    5253              for (var i = 0; i < userResult.length; i++) {
     54                if(userResult[i].Key == "Total Waiting Time" || userResult[i].Key == "Total Transfer Time" || userResult[i].Key == "Total Runtime") {
     55                  appendUnits = " seconds";
     56                }
     57                else if (userResult[i].Key == "Memory Required") {
     58                  appendUnits = " KB";
     59                }
     60                else {
     61                  appendUnits = "";
     62                }
    5363                $("#" + "@destinationTag").append('<label class="barLabel">' + userResult[i].Key + '</label>');
    54                 $("#" + "@destinationTag").append('<div class="outerBar"><div class="innerBar" id="InnerBar' + i + '"><label class="innerBarText">' + +userResult[i].Value.toFixed(4) + '</label></div></div><label class="outerBarText" id="OuterText' + i + '">' + +overallResult[i].Value.toFixed(4) + '</label>');
     64                $("#" + "@destinationTag").append(
     65                  '<div class="outerBar">' +
     66                    '<div class="innerBar" id="InnerBar' + i + '">' +
     67                      '<label class="innerBarText">' + +userResult[i].Value.toFixed(2) + appendUnits + '</label>' +
     68                    '</div>' +
     69                  '</div>' +
     70                  '<label class="outerBarText" id="OuterText' + i + '">' + +overallResult[i].Value.toFixed(2) + appendUnits + '</label>'
     71                );
    5572                $("#InnerBar" + i).css('width',((userResult[i].Value/overallResult[i].Value)*100).toFixed(2) + '%');
    5673              }
     
    7188        $.ajax({
    7289          url: "@(new HtmlString(url))?taskId=" + taskId, datatype: "json", success: function (result) {
     90            var appendUnits;
    7391            var appendString = '<table class="moreInfoTable"><tr>';
    7492            for (var i = 0; i < result.length; i++) {
     93              if (result[i].Key == "Memory Required") {
     94                appendUnits = " KB";
     95              }
     96              else {
     97                appendUnits = "";
     98              }
    7599              if(i % 2 == 0 && i != 0) {
    76100                appendString += '</tr><tr>';
    77101              }
    78102              appendString += '<td class="taskInfoCell"><label class="taskInfoKey">' + result[i].Key + '</label>';
    79               appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed(4) + '</label></td>';
     103              appendString += '<label class="taskInfoValue">' + +result[i].Value.toFixed(2) + appendUnits + '</label></td>';
    80104            }
    81105            appendString += '</tr></table>'
     
    93117}
    94118
    95 @helper MoreSlaveInfo(string url)
     119@helper MoreSlaveInfo(string url, string startDate, string endDate)
    96120{
    97121  <text>
    98122    function MoreSlaveInfo(caller) {
     123      CheckFilters();
    99124      if($(caller).siblings('.moreInfoTable').length == 0) {
    100125        var slaveId = $(caller).attr('id');
     126        var GetRequest = "?slaveId=" + slaveId;
     127        @if (startDate != null) {
     128          @:if(@(startDate)!=null) {
     129            @:GetRequest += "&start=" + @startDate;
     130          @:}
     131        }
     132        @if (endDate != null) {
     133          @:if(@(endDate)!=null) {
     134            @:GetRequest += "&end=" + @endDate;
     135          @:}
     136        }
    101137        $.ajax({
    102           url: "@(new HtmlString(url))?slaveId=" + slaveId, datatype: "json", success: function (result) {
     138          url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function (result) {
    103139            var appendString = '<table class="moreInfoTable"><tr>';
    104140            for (var i = 0; i < result[0].length; i++) {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ChartHelper.cshtml

    r11222 r11246  
    3636}
    3737
    38 @helper LineChartTime(string destinationTag, string url, string title = "", double? minY = null, double? maxY = null, string axisYFormat = null) {
     38@helper LineChartTime(string destinationTag, string url, string title = "", double? minY = null, double? maxY = null, string axisYFormat = null)
     39{
    3940  <script>
    4041    var @(destinationTag)Plot = $.jqplot("@destinationTag", "@url", {
     
    8990}
    9091
    91 @helper RefreshChart(string destinationTag, string url, string startDate, string endDate, double? minY=null, double? maxY=null) {
     92@helper RefreshChart(string destinationTag, string url, string startDate, string endDate, double? minY = null, double? maxY = null)
     93{
    9294  <text>
    9395  $.ajax({url: "@(new HtmlString(url))?start=" + @startDate + "&end=" + @endDate, datatype: "json", success: function(result) {
     
    9799    //Resets only the xaxis, still need to resize y with given min/max
    98100    @(destinationTag)Plot.replot({resetAxes:true});
    99     @if(minY != null) {
     101    @if (minY != null)
     102    {
    100103      //If min Y was provided set the plot's min Y value
    101104      @:@(destinationTag)Plot.axes.yaxis.min = @minY;
    102105    }
    103     @if(maxY != null) {
     106    @if (maxY != null)
     107    {
    104108      //If max Y was provided set the plot's max Y value
    105109      @:@(destinationTag)Plot.axes.yaxis.max = @maxY;
     
    162166  <text>
    163167    if(@(records).length > @limit) {
    164       $("#@container").append('<label class="pageTitle">Page: </label>')
     168      var appendPages = '<section class="pageContainer"><label class="pageTitle">Page: </label>';
    165169      var pages = Math.floor(@(records).length/@(limit)) + 1;
    166170      for(var i=0; i < pages; i++) {
    167         $("#" + "@container").append('<a id="@(container)Page' + (i + 1) + '" class="page">' + (i + 1) + '</a>')
    168       }
     171        appendPages += '<a id="@(container)Page' + (i + 1) + '" class="page">' + (i + 1) + '</a>';
     172      }
     173      appendPages += '</section>';
     174      $("#@container").append(appendPages);
    169175      if(@currentPage != null) {
    170176        $("#@(container)Page" + @currentPage).css('color','#F7921D');
     
    190196}
    191197
    192 @helper TasksForUser(string destinationTag, string url, string functionName, string userName, string limit, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string pageNumber = null)
     198@helper TaskContainers(string destinationTag, string url, string functionName, string userName, string limit, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string pageNumber = null)
    193199{
    194200  <text>
     
    235241      }
    236242      else {
    237         var waitTime;
    238         var transferTime;
    239         var runTime;
    240         var seriesDescriptions = ["Time waiting","Time transferring","Time calculating"];
    241 
    242243        //Checks if multipage display, if it is then trims results to
    243244        //the results for the page to be displayed
    244245        @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber)
    245246
    246         //Globally accesible, for use when resizing, eliminates extra DB request
    247         window["numberTasks"] = result.length;
    248 
    249247        //Set display of all errors to none, errors matching the tasks will be reset below
    250248        $("#@(destinationTag)").find(".errorContainer, .errorTitle, .errorTask, .errorMessage").css('display','none');
     
    252250        //Set variable for tracking jobId and open first job grouping
    253251        var currentJob = result[0].JobId;
    254         $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[0].JobId + '"><h1>' + result[0].JobName + '</h1></section>');
    255252
    256253        //For each result create a seperate collapsable section with a chart and info label
    257254        for(var i = 0; i < result.length; i++){
    258           if(currentJob != result[i].JobId) {
    259             $("#@(destinationTag)").append('<section class="jobTaskGroup" id="' + result[i].JobId + '"><h1>' + result[i].JobName + '</h1></section>');
     255          if(currentJob != result[i].JobId || i == 0) {
     256            $("#@(destinationTag)").append(
     257              '<section class="jobTaskGroup" id="' + result[i].JobId + '">' +
     258                '<h1>' + result[i].JobName + '</h1>' +
     259                '<section class="chartContainer">' +
     260                  '<h1 class="title" id="@(destinationTag)' + result[i].JobId + 'PlotTitle">Job Overview - ' + result[i].JobName + '</h1>' +
     261                  '<button class="collapse" onclick="LoadJob(this)">+</button>' +
     262                  '<div id="@(destinationTag)JobOverviewPlot' + i + '"></div>' +
     263                  '<label id="@(destinationTag)JobOverviewPlotInfo' + i + '"></label>' +
     264                '</section>' +
     265              '</section>'
     266            );
     267            CollapsedByDefault(document.getElementById("@(destinationTag)JobOverviewPlot" + i));
    260268            currentJob = result[i].JobId;
    261269          }
     
    263271            '<section class="chartContainer">' +
    264272              '<h1 class="title" id="@(destinationTag)' + result[i].TaskId + 'PlotTitle">Task ' + result[i].TaskId + '</h1>' +
    265               '<button class="collapse" onclick="CollapseSection(this)">+</button>' +
     273              '<button class="collapse" onclick="LoadTask(this)">+</button>' +
    266274              '<div id="@(destinationTag)Plot' + i + '"></div>' +
    267275              '<label id="@(destinationTag)PlotInfo' + i + '"></label>' +
    268276              '<a id="' + result[i].TaskId + '" class="moreInfo" onclick="MoreTaskInfo(this)">More Info</a>' +
    269277            '</section>'
    270           )
     278          );
    271279          //Re-enables the error display if any of the tasks on the page have Ids matching
    272280          //those of errors
     
    280288            }
    281289          });
    282           waitTime = [result[i].TotalWaiting];
    283           transferTime = [result[i].TotalTransfer];
    284           runTime = [result[i].TotalRuntime];
    285           window["@(destinationTag)Plot" + i] = $.jqplot("@(destinationTag)Plot" + i, [waitTime,transferTime,runTime], {
     290          CollapsedByDefault(document.getElementById("@(destinationTag)Plot" + i));
     291        }
     292      }
     293    }});
     294  </text>
     295}
     296
     297@helper LoadJob(string url)
     298{
     299  <text>
     300    function LoadJob(caller) {
     301      CheckFilters();
     302      if($(caller).next().html()=="") {
     303        var plotName = $(caller).next().attr('id');
     304        //Set current job id
     305        var jobId = $(caller).parent().parent().attr('id');
     306        var GetRequest = "?jobId=" + jobId;
     307
     308        $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
     309          CollapseSection(caller);
     310          var seriesDescription = ['Waiting','Transferring','Calculating','Finished','Error'];
     311          window[plotName] = $.jqplot(plotName, [[result.Wait],[result.Transfer],[result.Calculate],[result.Finish],[result.Error]], {
    286312            seriesDefaults:{
    287313              renderer:$.jqplot.BarRenderer,
    288314              shadowAngle: 135,
    289               pointLabels: {show: true, formatString: '%.3f'}
     315              pointLabels: {show: true, formatString: '%.0f'}
    290316            },
    291317            series:[
    292               {label:'Waiting'},
    293               {label:'Transferring'},
    294               {label:'Calculating'}
     318              {label:seriesDescription[0]},
     319              {label:seriesDescription[1]},
     320              {label:seriesDescription[2]},
     321              {label:seriesDescription[3]},
     322              {label:seriesDescription[4]}
    295323            ],
    296324            legend: {
     
    306334              },
    307335              yaxis: {
    308                 pad: 0
     336                padMax: 1.5
    309337              }
    310338            },
     
    315343          /* Bind a datalistener to each chart and display details of clicked
    316344            upon data in the label below the chart */
    317           $("#" + "@(destinationTag)Plot" + i).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
    318             $(this).next("label").html(seriesDescriptions[seriesIndex] + ": " + data[1]);
     345          $("#" + plotName).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
     346            $(this).next("label").html("Tasks " + seriesDescription[seriesIndex] + ": " + data[1]);
    319347          });
    320 
    321           CollapsedByDefault(document.getElementById("@(destinationTag)Plot" + i));
    322         }
    323       }
    324     }});
     348        }});
     349      }
     350      else {
     351        CollapseSection(caller);
     352      }
     353    }
     354  </text>
     355}
     356
     357@helper LoadTask(string url)
     358{
     359  <text>
     360    function LoadTask(caller) {
     361      CheckFilters();
     362      if($(caller).next().html()=="") {
     363        var plotName = $(caller).next().attr('id');
     364        //Set current slave id
     365        var currentTask = $(caller).siblings('a.moreInfo').attr('id');
     366        var GetRequest = "?taskId=" + currentTask;
     367
     368        $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
     369          var waitTime;
     370          var transferTime;
     371          var runTime;
     372          var seriesDescriptions = ["Time waiting","Time transferring","Time calculating"];
     373          CollapseSection(caller);
     374          for(i = 0; i < result.length; i++) {
     375            waitTime = [result[i].TotalWaiting];
     376            transferTime = [result[i].TotalTransfer];
     377            runTime = [result[i].TotalRuntime];
     378            window[plotName] = $.jqplot(plotName, [waitTime,transferTime,runTime], {
     379              seriesDefaults:{
     380                renderer:$.jqplot.BarRenderer,
     381                shadowAngle: 135,
     382                pointLabels: {show: true, formatString: '%.3f'}
     383              },
     384              series:[
     385                {label:'Waiting'},
     386                {label:'Transferring'},
     387                {label:'Calculating'}
     388              ],
     389              legend: {
     390                show: true,
     391                location: 'e',
     392                placement: 'outside'
     393              },
     394              axes: {
     395                xaxis: {
     396                  renderer: $.jqplot.CategoryAxisRenderer,
     397                  showLabel: false,
     398                  pad: 0
     399                },
     400                yaxis: {
     401                  pad: 0
     402                }
     403              },
     404              cursor: {
     405                showTooltip: false
     406              }
     407            });
     408            /* Bind a datalistener to each chart and display details of clicked
     409              upon data in the label below the chart */
     410            $("#" + plotName).bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) {
     411              $(this).next("label").html(seriesDescriptions[seriesIndex] + ": " + data[1].toFixed(4) + " seconds");
     412            });
     413          }
     414        }});
     415      }
     416      else {
     417        CollapseSection(caller);
     418      }
     419    }
    325420  </text>
    326421}
     
    467562}
    468563
    469 @helper SlaveInfoChart(string destinationTag, string url, string limit, bool singleSlave, string startDate = null, string endDate = null, string userName = null, string functionName = null, string pageNumber = null, string slaveId = null)
     564@helper SlaveContainers(string destinationTag, string url, string limit, bool singleSlave, string startDate = null, string endDate = null, string userName = null, string functionName = null, string pageNumber = null, string slaveId = null)
    470565{
    471566  <text>
     
    515610    @:}
    516611  }
    517   $.ajax({
    518     async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
    519 
    520     //Set chart names for use in creation below, must be set identically in
    521     //ResizeSlaves
     612  $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
     613    //Set chart names for use in creation below, must be set identically in LoadSlave and ResizeSlaves
    522614    var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"];
    523615
    524     var destTag = eval("@(destinationTag)");
    525     if(typeof eval("@(destinationTag)") != "string") {
    526       destTag = "@(destinationTag)";
     616    @if (!singleSlave) {
     617      @:$('#@(destinationTag)').html("");
     618
     619      //Checks if multipage display, if it is then trims results to
     620      //the results for the page to be displayed
     621      @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber)
     622
     623     
     624      @:var destTag = "@(destinationTag)";
     625    }
     626    else {
     627      @:var destTag = @(destinationTag);
    527628    }
    528629
    529630    if(result.length == 0) {
    530       @if (!singleSlave) {
     631      @if (!singleSlave)
     632      {
    531633        @:$('#' + destTag).html("");
    532634      }
     
    537639      )
    538640    }
    539     else {
    540       var time = new Date();
    541 
    542       @if (!singleSlave)
     641
     642    for(i = 0; i < result.length; i++) {
     643      $('#' + destTag).append(
     644        '<section class="chartContainer">' +
     645          '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].ClientName + '</h1>' +
     646          '<button class="collapse" onclick="LoadSlave(this)">+</button>' +
     647          '<div id="' + destTag + slaveChartNames[0] + 'Plot' + result[i][0].SlaveID + '"></div>' +
     648          '<div id="' + destTag + slaveChartNames[1] + 'Plot' + result[i][0].SlaveID + '"></div>' +
     649          '<div id="' + destTag + slaveChartNames[2] + 'Plot' + result[i][0].SlaveID + '"></div>' +
     650          '<a id="' + result[i][0].SlaveID + '" class="moreInfo" onclick="MoreSlaveInfo(this)">More Info</a>' +
     651        '</section>');
     652      for(k = 0; k < slaveChartNames.length; k++) {
     653        CollapsedByDefault(document.getElementById(destTag + slaveChartNames[k] + "Plot" + result[i][0].SlaveID));
     654      }
     655    }
     656  }});
     657  </text>
     658}
     659
     660@helper LoadSlave(string url, string limit, string startDate = null, string endDate = null, string userName = null, string pageNumber = null) {
     661  <text>
     662  function LoadSlave(caller) {
     663    CheckFilters();
     664    if($(caller).next().html()=="") {
     665      var destTag = $(caller).parent().parent().attr('id');
     666      //Set current slave id
     667      var currentSlave = $(caller).siblings('a.moreInfo').attr('id');
     668      var GetRequest = "?slaveId=" + currentSlave;
     669      @if (startDate != null)
    543670      {
    544         @:$('#' + destTag).html("");
    545 
    546         //Checks if multipage display, if it is then trims results to
    547         //the results for the page to be displayed
    548         @ChartHelper.NumberPages("result", limit, destinationTag, functionName, pageNumber)
    549       }
    550 
    551       for(i = 0; i < result.length; i++) {
     671        @:if(@(startDate)!=null) {
     672          @:GetRequest += "&start=" + @startDate;
     673        @:}
     674      }
     675      @if (endDate != null)
     676      {
     677        @:if(@(endDate)!=null) {
     678          @:GetRequest += "&end=" + @endDate;
     679        @:}
     680      }
     681      @if (userName != null)
     682      {
     683        @:if(@(userName)!=null) {
     684          @:GetRequest += "&userName=" + @userName;
     685        @:}
     686      }
     687      $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
     688        //Set chart names for use in creation below, must be set identically in SlaveContainers and ResizeSlaves
     689        var slaveChartNames = ["TotalUsedCores","TotalUsedMemory","CPUUtilization"];
     690        CollapseSection(caller);
     691        var time = new Date();
    552692        var coreSeries = [];
    553693        coreSeries[0] = [];
     
    558698        var cpuSeries = [];
    559699        cpuSeries[0] = [];
    560         $('#' + destTag).append(
    561           '<section class="chartContainer">' +
    562             '<h1 class="title" id="' + destTag + result[i][0].SlaveID + 'PlotTitle">Slave ' + result[i][0].ClientName + '</h1>' +
    563             '<button class="collapse" onclick="CollapseSection(this)">+</button>' +
    564             '<div id="' + destTag + slaveChartNames[0] + 'Plot' + i + '"></div>' +
    565             '<div id="' + destTag + slaveChartNames[1] + 'Plot' + i + '"></div>' +
    566             '<div id="' + destTag + slaveChartNames[2] + 'Plot' + i + '"></div>' +
    567             '<a id="' + result[i][0].SlaveID + '" class="moreInfo" onclick="MoreSlaveInfo(this)">More Info</a>' +
    568           '</section>');
    569         for(j = 0; j < result[i].length; j++) {
    570           time.setTime(result[i][j].Time.replace(/\D/g,''));
    571           coreSeries[0].push([time.toUTCString(),result[i][j].TotalCores]);
    572           coreSeries[1].push([time.toUTCString(),result[i][j].UsedCores]);
    573           memorySeries[0].push([time.toUTCString(),(result[i][j].TotalMemory / 1000)]);
    574           memorySeries[1].push([time.toUTCString(),(result[i][j].UsedMemory / 1000)]);
    575           cpuSeries[0].push([time.toUTCString(),result[i][j].CPUUtilization]);
    576         }
    577         if(result[i].length > 1) {
    578           @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[0]", "i", "coreSeries", "Total/Used Cores")
    579           @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[1]", "i", "memorySeries", "Total/Used Memory", 0)
    580           @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[2]", "i", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%")
     700        for(i = 0; i < result.length; i++) {
     701          time.setTime(result[i].Time.replace(/\D/g,''));
     702          coreSeries[0].push([time.toUTCString(),result[i].TotalCores]);
     703          coreSeries[1].push([time.toUTCString(),result[i].UsedCores]);
     704          memorySeries[0].push([time.toUTCString(),(result[i].TotalMemory / 1000)]);
     705          memorySeries[1].push([time.toUTCString(),(result[i].UsedMemory / 1000)]);
     706          cpuSeries[0].push([time.toUTCString(),result[i].CPUUtilization]);
     707        }
     708        if(result.length > 1) {
     709          @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[0]", "currentSlave", "coreSeries", "Total/Used Cores")
     710          @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[1]", "currentSlave", "memorySeries", "Total/Used Memory", 0)
     711          @ChartHelper.LineChartGivenSeries("destTag + slaveChartNames[2]", "currentSlave", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%")
    581712        }
    582713        else {
    583           @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[0]", "i", "coreSeries", "Total/Used Cores")
    584           @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[1]", "i", "memorySeries", "Total/Used Memory", 0)
    585           @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[2]", "i", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%")
    586         }
    587         for(k = 0; k < slaveChartNames.length; k++) {
    588           CollapsedByDefault(document.getElementById(destTag + slaveChartNames[k] + "Plot" + i));
    589         }
    590       }
    591     }
    592   }});
     714          @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[0]", "currentSlave", "coreSeries", "Total/Used Cores")
     715          @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[1]", "currentSlave", "memorySeries", "Total/Used Memory", 0)
     716          @ChartHelper.BarChartGivenSeries("destTag + slaveChartNames[2]", "currentSlave", "cpuSeries", "CPU Utilization", 0, 100, "%.1f%%")
     717        }
     718      }});
     719    }
     720    else {
     721      CollapseSection(caller);
     722    }
     723  }
    593724  </text>
    594725}
     
    686817  </text>
    687818}
     819
     820@helper UserTasks(string url, string insertAfter, string taskState) {
     821  <text>
     822    var GetRequest = "?taskState=@(taskState)";
     823
     824    $.ajax({ async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
     825      if(result.length==0) {
     826        $("@(insertAfter)").after(
     827          '<section class="chartContainer">' +
     828            '<h1 class="title">No users currently have any tasks ' + @(taskState) + '!</h1>' +
     829          '</section>'
     830        )
     831      }
     832      else {
     833        $("@(insertAfter)").after(
     834          '<section class="chartContainer">' +
     835            '<h1 class="title" id="UserTask@(taskState)PlotTitle">@(taskState) Tasks</h1>' +
     836            '<button class="collapse" onclick="CollapseSection(this)">-</button>' +
     837            '<div id="UserTask@(taskState)Plot" class="noXTicks"></div>' +
     838          '</section>'
     839        );
     840      }
     841      var userTasks = [];
     842      var userNames = [];
     843      for (i=0; i < result.length; i++) {
     844        userTasks[i] = [result[i].Value];
     845        userNames[i] = { label: result[i].Key };
     846      }
     847      window["UserTask@(taskState)Plot"] = $.jqplot("UserTask@(taskState)Plot", userTasks, {
     848        title: "Users with @(taskState) Tasks",
     849        seriesDefaults:{
     850          renderer:$.jqplot.BarRenderer,
     851          shadowAngle: 135,
     852          pointLabels: {show: true, formatString: '%.3f'}
     853        },
     854        series: userNames,
     855        legend: {
     856          show: true,
     857          location: 'e',
     858          placement: 'outside'
     859        },
     860        axes: {
     861          xaxis: {
     862            renderer: $.jqplot.CategoryAxisRenderer,
     863            showTicks: false,
     864            pad: 0
     865          },
     866          yaxis: {
     867            padMax: 1.5
     868          }
     869        },
     870        cursor: {
     871          showTooltip: false
     872        }
     873      });
     874    }});
     875  </text>
     876}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/App_Code/ExceptionHelper.cshtml

    r11222 r11246  
    1818 *@
    1919
    20 @helper UserExceptions(string destinationTag, string url, string limit, string userName = null, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string slaveId=null)
     20@helper UserExceptions(string destinationTag, string url, string userName = null, string startDate = null, string endDate = null, string jobId = null, string taskState = null, string slaveId=null)
    2121{
    2222  <text>
     
    8888  }
    8989
    90   $.ajax({async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json", success: function(result) {
     90  $.ajax({async: false, url: "@(new HtmlString(url))" + GetRequest, datatype: "json",
     91    error: function(xhr,err) {
     92      alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
     93      alert("responseText: "+xhr.responseText);
     94    },
     95    success: function(result) {
    9196      $("#" + "@destinationTag").html("");
    9297      if(result.Key.length > 0) {
     
    96101                          '<label class="errorMessage underline">Error</label>';
    97102        for (var i = 0; i < result.Key.length; i++) {
    98           ErrorHTML += '<a class="errorTask" onclick="ScrollTo(this)">' + result.Key[i] + '</a>' +
    99                         '<label class="errorMessage">' + result.Value[i] + '</label>';
     103          ErrorHTML += '<a class="errorTask" onclick="ScrollTo(this)">' + result.Key[i] + '</a>';
     104          if(result.Value[i].length > 100) {
     105            ErrorHTML += '<a class="errorMessage shortVerison" onclick="ShowFullError(this)">Click to show full message</a>';
     106            ErrorHTML += '<label class="errorMessage longVersion">' + result.Value[i] + '</label>';
     107          }
     108          else {
     109            ErrorHTML += '<label class="errorMessage">' + result.Value[i] + '</label>';
     110          }
    100111        }
    101112        ErrorHTML += '</section>';
     
    118129    function ScrollTo(caller) {
    119130      var taskErrorId = $(caller).parent().parent().attr('id') + $(caller).html() + "PlotTitle";
    120       OpenOnError(document.getElementById(taskErrorId));
     131      $("#" + taskErrorId).parent().find("button").click();
    121132      $('html, body').animate({
    122133          scrollTop: $("#" + taskErrorId).parent().offset().top
     
    238249  function ShowSlaveInfo(caller) {
    239250    var taskSlaveId = $(caller).attr('id');
     251    CheckFilters();
    240252    if($(caller).parent().parent().children(".chartContainer").length == 0) {
    241       @ChartHelper.SlaveInfoChart("caller.parentNode.parentNode.id",url,limit,true,startDate,endDate,null,null,null,"taskSlaveId")
     253      var destinationTag = $(caller).parent().parent().attr('id');
     254      @ChartHelper.SlaveContainers("destinationTag",url,limit,true,startDate,endDate,null,null,null,"taskSlaveId")
    242255    }
    243256    else {
     
    247260  </text>
    248261}
     262
     263@helper ShowFullError() {
     264  <text>
     265  function ShowFullError(caller) {
     266    $(caller).css('display','none');
     267    $(caller).next().css('display','inline-block');
     268  }
     269  </text>
     270}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Content/Site.css

    r11222 r11246  
    9494.errorTask {
    9595  margin-left: 2%;
    96 }
    97 
    98 a.errorTask {
     96  vertical-align: top;
     97}
     98
     99a.errorTask, .shortVerison {
    99100  cursor: pointer;
     101}
     102
     103.shortVerison {
     104  text-decoration: underline;
    100105}
    101106
     
    294299
    295300/* Multi-page Task Styles */
     301.pageContainer {
     302  width: 100%;
     303  padding-left: 2%;
     304}
     305
    296306.pageTitle, .page {
    297307  margin-right: 1%;
     
    300310}
    301311
    302 .pageTitle {
    303   margin-left: 2%;
    304 }
    305 
    306312.page {
    307313  text-decoration: underline;
    308314  cursor: pointer;
     315  display: inline-block;
    309316}
    310317
     
    516523  background-color: rgba(247,146,29,0.42);
    517524}
     525
     526.noXTicks .jqplot-xaxis {
     527  display: none;
     528}
     529
     530.currentStats table {
     531  width: 66%;
     532  margin: 2% 0% 0% 17%;
     533  -webkit-border-radius: 5px;
     534  -moz-border-radius: 5px;
     535  border-radius: 5px;
     536  border: 1px solid #8297F5;
     537}
     538
     539.currentStats td:first-of-type, .currentStats td:nth-of-type(3) {
     540  width: 35%;
     541  padding-top: 1%;
     542  padding-left: 1%;
     543}
     544
     545.currentStats td:nth-of-type(2), .currentStats td:nth-of-type(4) {
     546  width: 15%;
     547}
     548
     549.currentStats tr:last-of-type td {
     550  padding-bottom: 1%;
     551}
     552
     553.currentStats tr td:nth-of-type(2) {
     554  border-right: 1px solid #8297F5;
     555}
     556
    518557/* User Page Styles*/
    519558#TasksContainer div[id^="Task"] {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/AdminDataController.cs

    r11222 r11246  
    7373    }
    7474
    75     public JsonResult MoreSlaveInfo(string slaveId) {
     75    public JsonResult MoreSlaveInfo(string slaveId, DateTime? start = null, DateTime? end = null) {
    7676      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
    7777      {
    7878        var moreInfo = (from slaves in db.FactClientInfos
    79                         where slaves.ClientId.ToString() == slaveId
     79                        where slaves.ClientId.ToString() == slaveId &&
     80                        (!start.HasValue || slaves.Time >= start) &&
     81                        (!end.HasValue || slaves.Time < end)
    8082                        select new
    8183                        {
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs

    r11222 r11246  
    139139    }
    140140
    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)) {
     141    public JsonResult GetTasks(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      {
    143145        TaskState? state = GetTaskState(taskState);
    144146
     
    157159             JobId = jobs.JobId,
    158160             TaskId = tasks.TaskId,
     161             StartDate = tasks.StartTime
     162           }).OrderByDescending(s => s.StartDate).ToList();
     163
     164        //Was overflowing default MaxJsonLength
     165        //return Json(data, JsonRequestBehavior.AllowGet);
     166        return new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue };
     167      }
     168    }
     169
     170    public JsonResult TaskInfo(string taskId)
     171    {
     172      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     173      {
     174        var data =
     175          (from tasks in db.FactTasks
     176           join jobs in db.DimJobs
     177             on tasks.JobId equals jobs.JobId
     178           where tasks.TaskId.ToString() == taskId
     179           select new
     180           {
    159181             TotalWaiting = tasks.TotalWaitingTime,
    160182             TotalTransfer = tasks.TotalTransferTime,
     
    167189    }
    168190
    169     public JsonResult SlaveInfo(DateTime? start = null, DateTime? end = null, string userName = null, string slaveId=null)
     191    public JsonResult GetSlaves(DateTime? start = null, DateTime? end = null, string userName = null, string slaveId = null)
    170192    {
    171193      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     
    185207             ClientName = clients.Name,
    186208             SlaveID = slaves.ClientId,
     209           }).GroupBy(s => s.SlaveID).ToList();
     210        //Was overflowing default MaxJsonLength
     211        //return Json(data, JsonRequestBehavior.AllowGet);
     212        return new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue };
     213      }
     214    }
     215
     216    public JsonResult SlaveInfo(string slaveId, DateTime? start = null, DateTime? end = null, string userName = null) {
     217      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     218      {
     219        var data =
     220          (from slaves in db.FactClientInfos
     221           join users in db.DimUsers
     222            on slaves.UserId equals users.UserId
     223           join clients in db.DimClients
     224            on slaves.ClientId equals clients.Id
     225           where  slaves.ClientId.ToString() == slaveId &&
     226           (!start.HasValue || slaves.Time >= start) &&
     227           (!end.HasValue || slaves.Time < end) &&
     228           (string.IsNullOrEmpty(userName) || users.Name == userName)
     229           select new
     230           {
     231             ClientName = clients.Name,
     232             SlaveID = slaves.ClientId,
    187233             Time = slaves.Time,
    188234             UsedCores = slaves.NumUsedCores,
     
    191237             TotalMemory = slaves.TotalMemory,
    192238             CPUUtilization = slaves.CpuUtilization
    193            }).OrderByDescending(s => s.Time).GroupBy(s => s.SlaveID).ToList();
     239           }).OrderByDescending(s => s.Time).ToList();
    194240
    195241        return Json(data, JsonRequestBehavior.AllowGet);
     242      }
     243    }
     244
     245    public JsonResult JobProgress(string jobId) {
     246      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) {
     247        var data =
     248          (from tasks in db.FactTasks
     249           where tasks.JobId.ToString() == jobId
     250           select new
     251           {
     252             State = tasks.TaskState
     253           }).ToList();
     254
     255        Dictionary<string, int> JobTasks = new Dictionary<string,int>();
     256        JobTasks.Add("Wait",0);
     257        JobTasks.Add("Transfer", 0);
     258        JobTasks.Add("Calculate", 0);
     259        JobTasks.Add("Finish", 0);
     260        JobTasks.Add("Error", 0);
     261
     262        foreach(var record in data) {
     263          switch (record.State) {
     264            case TaskState.Waiting:
     265              JobTasks["Wait"] += 1;
     266              break;
     267            case TaskState.Transferring:
     268              JobTasks["Transfer"] += 1;
     269              break;
     270            case TaskState.Calculating:
     271              JobTasks["Calculate"] += 1;
     272              break;
     273            case TaskState.Finished:
     274              JobTasks["Finish"] += 1;
     275              break;
     276            case TaskState.Aborted:
     277            case TaskState.Failed:
     278              JobTasks["Error"] += 1;
     279              break;
     280          }
     281        }
     282
     283        return Json(JobTasks, JsonRequestBehavior.AllowGet);
     284      }
     285    }
     286
     287    public JsonResult UserTasks(string taskState) {
     288      TaskState? state = GetTaskState(taskState);
     289      List<KeyValuePair<string, int>> numberTasksByUser = new List<KeyValuePair<string,int>>();
     290      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) {
     291        var userTasks = (from tasks in db.FactTasks
     292                         join jobs in db.DimJobs
     293                           on tasks.JobId equals jobs.JobId
     294                         where tasks.TaskState == state
     295                         select new
     296                         {
     297                           UserID = jobs.UserId,
     298                           UserName = jobs.UserName,
     299                           State = tasks.TaskState
     300                         }).GroupBy(j => j.UserID).ToList();
     301
     302        foreach (var user in userTasks) {
     303          numberTasksByUser.Add(new KeyValuePair<string, int>(user.First().UserName, user.Count()));
     304        }
     305        return Json(numberTasksByUser, JsonRequestBehavior.AllowGet);
    196306      }
    197307    }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ExceptionDataController.cs

    r11222 r11246  
    3636        data.ForEach(t => Task.Add(t.TaskID.ToString()));
    3737        data.ForEach(e => Error.Add(e.ErrorMessage));
    38 
    39         return Json(new KeyValuePair<List<string>, List<string>>(Task, Error), JsonRequestBehavior.AllowGet);
     38       
     39        //Was overflowing default MaxJsonLength
     40        //return Json(new KeyValuePair<List<string>, List<string>>(Task, Error), JsonRequestBehavior.AllowGet);
     41        return new JsonResult() { Data = new KeyValuePair<List<string>, List<string>>(Task, Error), JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue };
    4042      }
    4143    }
    4244
    43     public JsonResult SlaveExceptions(string limit, DateTime? start = null, DateTime? end = null, string clientId = null) {
     45    public JsonResult SlaveExceptions(DateTime? start = null, DateTime? end = null, string clientId = null) {
    4446      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) {
    4547        var data =
     
    7375          );
    7476        }
    75         return Json(results, JsonRequestBehavior.AllowGet);
     77        //Was overflowing default MaxJsonLength
     78        //return Json(results, JsonRequestBehavior.AllowGet);
     79        return new JsonResult() { Data = results, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue };
    7680      }
    7781    }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/HomeController.cs

    r11053 r11246  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using System.Web.Mvc;
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Models/OverallStatistics.cs

    r9617 r11246  
    1 namespace HeuristicLab.Services.Hive.Statistics.Models {
     1using System;
     2using System.Collections.Generic;
     3namespace HeuristicLab.Services.Hive.Statistics.Models {
    24  public class OverallStatus {
    35    public int OverallCurrentlyAvailableCores { get; set; }
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/Home/Index.cshtml

    r11196 r11246  
    66
    77<h1>Current Status</h1>
     8<section class="currentStats">
     9  <table>
     10    <tr>
     11      <td>Overall Available Cores</td>
     12      <td>@Model.OverallCurrentlyAvailableCores</td>
     13      <td>System-wide Waiting Tasks</td>
     14      <td>@Model.CurrentlyJobsWaiting</td>
     15    </tr>
     16    <tr>
     17      <td>Real Available Cores</td>
     18      <td>@Model.CurrentlyAvailableCores</td>
     19      <td>Overall Average CPU Utilization</td>
     20      <td>@Model.OverallCpuUtilization</td>
     21    </tr>
     22    <tr>
     23      <td>Used Cores</td>
     24      <td>@Model.CurrentlyUsedCores</td>
     25      <td>Real Average CPU Utilization</td>
     26      <td>@Model.AvailableCpuUtilization</td>
     27    </tr>
     28  </table>
     29</section>
    830<section class="chartContainer">
    931  <h1 class="title">Current Hive Status</h1>
     
    1335  <div id="CurrentTotalUsedMemory"></div>
    1436</section>
    15 
    1637<section class="chartContainer">
    1738  <h1 class="title">Historic Hive Status</h1>
     
    4970
    5071  @Scripts.Render("~/Scripts/jqPlot/jquery.jqplot")
     72  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.barRenderer.min.js")
     73  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js")
     74  @Scripts.Render("~/Scripts/jqPlot/plugins/jqplot.pointLabels.min.js")
    5175  @ChartHelper.AjaxDataRenderer()
    5276
     
    80104        RefreshCharts();
    81105      });
     106
     107      @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Calculating");
     108      @ChartHelper.UserTasks(Url.Action("UserTasks", "ChartData"), "section.currentStats", "Waiting");
    82109    });
    83110
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/Admin.cshtml

    r11222 r11246  
    22
    33@{
    4     ViewBag.Title = "Admin";
    5 }
    6 
    7 @if(!Model.IsAdmin) {
     4  ViewBag.Title = "Admin";
     5}
     6
     7@if (!Model.IsAdmin)
     8{
    89  <h1>The user you are logged in as: @Model.UserName, is not an administrator.</h1>
    910}
    10 else {
     11else
     12{
    1113    <!--[if gte IE 9]>
    1214    <style type="text/css">
     
    227229    //User Overview
    228230    function RefreshUser() {
    229       CheckFilters("User");
    230       @ExceptionHelper.UserExceptions("TasksContainer", Url.Action("TaskExceptions", "ExceptionData"), "limit", "selectedUser", "startDate", "endDate", "jobId", "taskState")
    231       @ChartHelper.TasksForUser("TasksContainer",Url.Action("UserTask", "ChartData"), "RefreshUser", "selectedUser", "limit", "startDate", "endDate", "jobId", "taskState", "pageNumber")
     231      CheckFilters();
     232      @ExceptionHelper.UserExceptions("TasksContainer", Url.Action("TaskExceptions", "ExceptionData"), "selectedUser", "startDate", "endDate", "jobId", "taskState")
     233      @ChartHelper.TaskContainers("TasksContainer", Url.Action("GetTasks", "ChartData"), "RefreshUser", "selectedUser", "limit", "startDate", "endDate", "jobId", "taskState", "pageNumber")
    232234      pageNumber = null;
    233235    }
     
    235237    //Task Overview
    236238    $("#TaskUserList").change(function () {
     239      CheckFilters();
    237240      RefreshTask();
    238241    });
    239242
    240243    function RefreshTask() {
    241       CheckFilters("Task");
     244      CheckFilters();
    242245      @AdminHelper.UserTaskStats("TaskStatsContainer", Url.Action("TaskStats", "AdminData"), "selectedUser", "startDate", "endDate")
    243246    }
     
    245248    //Slave Overview
    246249    function RefreshSlave() {
    247       CheckFilters("Slave");
    248       @ChartHelper.SlaveInfoChart("SlavesContainer", Url.Action("SlaveInfo", "ChartData"), "limit", false, "startDate", "endDate", "selectedUser", "RefreshSlave", "pageNumber")
     250      CheckFilters();
     251      @ChartHelper.SlaveContainers("SlavesContainer", Url.Action("GetSlaves", "ChartData"), "limit", false, "startDate", "endDate", "selectedUser", "RefreshSlave", "pageNumber")
    249252      pageNumber = null;
    250253    }
     
    256259
    257260    function RefreshException() {
    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")
     261      CheckFilters();
     262      @ExceptionHelper.UserExceptions("ExceptionContainer", Url.Action("TaskExceptions", "ExceptionData"), null, "startDate", "endDate", null, null, "selectedSlave")
     263      @ExceptionHelper.ErrorsOnSlaves("ExceptionContainer", Url.Action("SlaveExceptions", "ExceptionData"), "limit", "startDate", "endDate", "selectedSlave", "RefreshException", "pageNumber")
     264    }
    263265
    264266    //General Chart Methods
    265     function CheckFilters(currentTab) {
     267    function CheckFilters() {
    266268      startDate = null;
    267269      endDate = null;
    268       switch(currentTab) {
    269         case "User":
     270      switch($('.tabSection:visible').attr('id')) {
     271        case "UserOverviewTab":
    270272          selectedUser = $("#UserList").val();
    271273          jobId = null;
     
    283285          }
    284286          break;
    285         case "Task":
     287        case "TaskOverviewTab":
    286288          selectedUser = $("#TaskUserList").val();
    287289          startDate = $('#TaskStart').val();
    288290          endDate = $('#TaskEnd').val();
    289291          break;
    290         case "Slave":
     292        case "SlaveOverviewTab":
    291293          selectedUser = null;
    292294          limit = $("#SlaveLimit").val();
     
    299301          }
    300302          break;
    301         case "Exception":
     303        case "ExceptionOverviewTab":
    302304          selectedSlave = null;
     305          selectedUser = null;
    303306          limit = $("#ExceptionLimit").val();
    304307          if ($("[value='ExceptionDate']").is(":checked")) {
     
    313316
    314317    @ChartHelper.ResizeCharts()
     318    @ChartHelper.LoadTask(Url.Action("TaskInfo", "ChartData"))
     319    @ChartHelper.LoadJob(Url.Action("JobProgress", "ChartData"))
     320    @ChartHelper.LoadSlave(Url.Action("SlaveInfo", "ChartData"), "limit", "startDate", "endDate", "selectedUser", "pageNumber")
    315321    @ExceptionHelper.ScrollToException()
    316     @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo","AdminData"))
    317     @AdminHelper.MoreSlaveInfo(Url.Action("MoreSlaveInfo","AdminData"))
     322    @ExceptionHelper.ShowFullError()
     323    @ExceptionHelper.ShowSlaveInfo(Url.Action("GetSlaves", "ChartData"), "limit", "startDate", "endDate")
     324    @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo", "AdminData"))
     325    @AdminHelper.MoreSlaveInfo(Url.Action("MoreSlaveInfo", "AdminData"), "startDate", "endDate")
    318326  </script>
    319327}
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Views/LoginRequired/UserTask.cshtml

    r11222 r11246  
    114114
    115115    function TaskInformation() {
    116       limit = $('#Limit').val();
    117       startDate = null;
    118       endDate = null;
    119       jobId = null;
    120       taskState = null;
    121       if ($("[value='Date']").is(":checked")) {
    122         startDate = $('#InfoStart').val();
    123         endDate = $('#InfoEnd').val();
    124       }
    125       if ($("[value='JobName']").is(':checked')) {
    126         jobId = $('#JobNames').val();
    127       }
    128       if ($("[value='TaskState']").is(':checked')) {
    129         taskState = $('#TaskStates').val();
    130       }
    131       @ExceptionHelper.UserExceptions("TasksContainer",Url.Action("TaskExceptions", "ExceptionData"),"limit","userName","startDate","endDate","jobId","taskState")
    132       @ChartHelper.TasksForUser("TasksContainer",Url.Action("UserTask", "ChartData"),"TaskInformation","userName","limit","startDate","endDate","jobId","taskState","pageNumber")
     116      CheckFilters();
     117      @ExceptionHelper.UserExceptions("TasksContainer",Url.Action("TaskExceptions", "ExceptionData"),"userName","startDate","endDate","jobId","taskState")
     118      @ChartHelper.TaskContainers("TasksContainer",Url.Action("GetTasks", "ChartData"),"TaskInformation","userName","limit","startDate","endDate","jobId","taskState","pageNumber")
    133119      pageNumber = null;
    134120    }
    135121
    136122    function TaskOverview() {
    137       startDate = $('#OverviewStart').val();
    138       endDate = $('#OverviewEnd').val();
     123      CheckFilters();
    139124      @AdminHelper.UserTaskStats("TaskStatsContainer",Url.Action("TaskStats", "AdminData"),"userName","startDate","endDate")
    140125    }
     
    148133    })
    149134
     135    //General Chart Methods
     136    function CheckFilters() {
     137      startDate = null;
     138      endDate = null;
     139      switch ($('.tabSection:visible').attr('id')) {
     140        case "TaskInformationTab":
     141          limit = $('#Limit').val();
     142          jobId = null;
     143          taskState = null;
     144          if ($("[value='Date']").is(":checked")) {
     145            startDate = $('#InfoStart').val();
     146            endDate = $('#InfoEnd').val();
     147          }
     148          if ($("[value='JobName']").is(':checked')) {
     149            jobId = $('#JobNames').val();
     150          }
     151          if ($("[value='TaskState']").is(':checked')) {
     152            taskState = $('#TaskStates').val();
     153          }
     154          break;
     155        case "TaskOverviewTab":
     156          startDate = $('#OverviewStart').val();
     157          endDate = $('#OverviewEnd').val();
     158          break;
     159      }
     160    }
    150161    TaskInformation();
    151162    @ChartHelper.ResizeCharts()
     163    @ChartHelper.LoadTask(Url.Action("TaskInfo", "ChartData"))
     164    @ChartHelper.LoadJob(Url.Action("JobProgress", "ChartData"))
    152165    @ExceptionHelper.ScrollToException()
     166    @ExceptionHelper.ShowFullError()
    153167    @AdminHelper.MoreTaskInfo(Url.Action("MoreTaskInfo","AdminData"))
    154168  </script>
Note: See TracChangeset for help on using the changeset viewer.