Changeset 11259 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers
- Timestamp:
- 08/04/14 13:01:40 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.Statistics/3.3/Controllers/ChartDataController.cs
r11255 r11259 92 92 } 93 93 94 public JsonResult CurrentCpuUtilization( )94 public JsonResult CurrentCpuUtilization(string state) 95 95 { 96 96 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 102 102 on clients.ResourceId equals resource.ResourceId 103 103 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) 105 109 select new { client.ClientId, client.CpuUtilization, client.Time }) 106 110 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); … … 113 117 } 114 118 115 public JsonResult CurrentCores( )119 public JsonResult CurrentCores(string state) 116 120 { 117 121 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 123 127 on clients.ResourceId equals resource.ResourceId 124 128 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) 126 134 select new { client.ClientId, client.NumTotalCores, client.NumUsedCores, client.Time }) 127 135 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList(); … … 135 143 } 136 144 137 public JsonResult CurrentMemory( )145 public JsonResult CurrentMemory(string state) 138 146 { 139 147 using (var db = new HiveDataContext(Settings.Default.HeuristicLab_Hive_LinqConnectionString)) … … 145 153 on clients.ResourceId equals resource.ResourceId 146 154 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) 148 160 select new { client.ClientId, client.TotalMemory, client.UsedMemory, client.Time }) 149 161 .OrderBy(c => c.Time).GroupBy(c => c.ClientId).ToList();
Note: See TracChangeset
for help on using the changeset viewer.