Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/12 16:27:46 (12 years ago)
Author:
ascheibe
Message:

#1994 added displaying statistics for groups

File:
1 edited

Legend:

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

    r9023 r9025  
    4444    Dictionary<Guid, int> calculatingTasksByUser = new Dictionary<Guid,int>();
    4545    Dictionary<Guid, int> waitingTasksByUser = new Dictionary<Guid, int>();
     46    List<DT.Resource> groups = new List<DT.Resource>();
     47
     48    transactionManager.UseTransaction(() => {
     49       groups = dao.GetResources(x => x.ResourceType == "GROUP").ToList();
     50    }, false, false);   
    4651
    4752    if (!string.IsNullOrEmpty(resourceName)) {
     
    7681
    7782    slavesLabel.Text = string.Join(", ", onlineSlaves.Select(x => string.Format("<a href=\"?resource={0}\">{0}</a> ({1} %)", x.Name, Math.Round(x.CpuUtilization, 2))));
     83    groupsLabel.Text = string.Join(", ", groups.Select(x => string.Format("<a href=\"?resource={0}\">{0}</a>", x.Name)));
    7884
    7985    overallCpuUtilizationLabel.Text = (onlineSlaves.Count() > 0 ? Math.Round(onlineSlaves.Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %";
    80     cpuUtilizationLabel.Text = (onlineSlaves.Count() > 0 ? Math.Round(onlineSlaves.Where(x => x.IsAllowedToCalculate).Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %";
     86    cpuUtilizationLabel.Text = (onlineSlaves.Count() > 0 && onlineSlaves.Where(x => x.IsAllowedToCalculate).Count() > 0 ? Math.Round(onlineSlaves.Where(x => x.IsAllowedToCalculate).Average(s => s.CpuUtilization), 2).ToString() : "0.0") + " %";
    8187
    8288    DT.Statistics[] stats = new DT.Statistics[0];   
Note: See TracChangeset for help on using the changeset viewer.