Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/12 15:07:54 (12 years ago)
Author:
ascheibe
Message:

#1994 added a dao method which loads lightweight tasks instead of tasks. Therefore the task datas are not loaded which reduces memory consumption and improves performance when

  • downloading tasks
  • refresh automatically is checked in the Hive Job Manager
  • loading the Hive Status page.

The Hive Status page now shows which users are currently calculating how many tasks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.Hive.Web/Hive-3.3/Status.aspx.cs

    r7259 r9022  
    4242    IEnumerable<DT.Slave> onlineSlaves = new List<DT.Slave>();
    4343    int currentlyJobsWaiting = 0;
     44    Dictionary<Guid, int> calculatingTasksByUser = new Dictionary<Guid,int>();
     45    Dictionary<Guid, int> waitingTasksByUser = new Dictionary<Guid, int>();
    4446
    4547    if (!string.IsNullOrEmpty(resourceName)) {
     
    5860    transactionManager.UseTransaction(() =>
    5961    {                     
    60         onlineSlaves = dao.GetSlaves(x => (x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle) && resourceIds.Contains(x.ResourceId));
    61         currentlyJobsWaiting = dao.GetTasks(x => x.State == DA.TaskState.Waiting).Count();
     62        onlineSlaves = dao.GetSlaves(x => (x.SlaveState == DA.SlaveState.Calculating || x.SlaveState == DA.SlaveState.Idle) && resourceIds.Contains(x.ResourceId));       
     63        currentlyJobsWaiting = dao.GetLightweightTasks(x => x.State == DA.TaskState.Waiting).Count();
     64        calculatingTasksByUser = dao.GetCalculatingTasksByUser();
     65        waitingTasksByUser = dao.GetWaitingTasksByUser();
    6266    }, false, false);
    6367
     
    101105      memoryChart.Series[1].Points.AddXY(s.TimeStamp.ToOADate(), usedMemory / 1024.0);
    102106    }
     107
     108    foreach (var kvp in waitingTasksByUser) {
     109      TableRow curRow = new TableRow();
     110      TableCell cellUser = new TableCell();
     111      cellUser.Text = ServiceLocator.Instance.UserManager.GetUserById(kvp.Key).UserName;
     112      TableCell cellCnt = new TableCell();
     113      cellCnt.Text = kvp.Value.ToString();
     114
     115      curRow.Cells.Add(cellUser);
     116      curRow.Cells.Add(cellCnt);
     117      waitingTasksByUserTable.Rows.Add(curRow);
     118    }
     119
     120    foreach (var kvp in calculatingTasksByUser) {
     121      TableRow curRow = new TableRow();
     122      TableCell cellUser = new TableCell();
     123      cellUser.Text = ServiceLocator.Instance.UserManager.GetUserById(kvp.Key).UserName;
     124      TableCell cellCnt = new TableCell();
     125      cellCnt.Text = kvp.Value.ToString();
     126
     127      curRow.Cells.Add(cellUser);
     128      curRow.Cells.Add(cellCnt);
     129      calculatingTasksByUserTable.Rows.Add(curRow);
     130    }
    103131  }
    104132}
Note: See TracChangeset for help on using the changeset viewer.