Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/04/14 13:01:40 (10 years ago)
Author:
mroscoe
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs

    r11255 r11259  
    9292    }
    9393
    94     public JsonResult CurrentCpuUtilization()
     94    public JsonResult CurrentCpuUtilization(string state)
    9595    {
    9696      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     
    102102                               on clients.ResourceId equals resource.ResourceId
    103103                             where clients.ExpirationTime == null &&
    104                              (resource.SlaveState == SlaveState.Calculating || resource.SlaveState == SlaveState.Idle)
     104                             (state == "All") ||
     105                             (state == "Online") &&
     106                             (client.SlaveState == SlaveState.Idle || client.SlaveState == SlaveState.Calculating ) ||
     107                             (state == "Available") &&
     108                             (client.SlaveState == SlaveState.Idle)
    105109                             select new { client.ClientId, client.CpuUtilization, client.Time })
    106110                             .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList();
     
    113117    }
    114118
    115     public JsonResult CurrentCores()
     119    public JsonResult CurrentCores(string state)
    116120    {
    117121      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     
    123127                             on clients.ResourceId equals resource.ResourceId
    124128                            where clients.ExpirationTime == null &&
    125                             (resource.SlaveState == SlaveState.Calculating || resource.SlaveState == SlaveState.Idle)
     129                            (state == "All") ||
     130                            (state == "Online") &&
     131                            (client.SlaveState == SlaveState.Idle || client.SlaveState == SlaveState.Calculating) ||
     132                            (state == "Available") &&
     133                            (client.SlaveState == SlaveState.Idle)
    126134                            select new { client.ClientId, client.NumTotalCores, client.NumUsedCores, client.Time })
    127135                            .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList();
     
    135143    }
    136144
    137     public JsonResult CurrentMemory()
     145    public JsonResult CurrentMemory(string state)
    138146    {
    139147      using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString))
     
    145153                              on clients.ResourceId equals resource.ResourceId
    146154                            where clients.ExpirationTime == null &&
    147                             (resource.SlaveState == SlaveState.Calculating || resource.SlaveState == SlaveState.Idle)
     155                            (state == "All") ||
     156                            (state == "Online") &&
     157                            (client.SlaveState == SlaveState.Idle || client.SlaveState == SlaveState.Calculating) ||
     158                            (state == "Available") &&
     159                            (client.SlaveState == SlaveState.Idle)
    148160                            select new { client.ClientId, client.TotalMemory, client.UsedMemory, client.Time })
    149161                            .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList();
Note: See TracChangeset for help on using the changeset viewer.