- Timestamp:
- 11/26/13 11:56:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/simulator/stats/implementation/TaskStats.java
r1199 r1207 2 2 3 3 4 import java.util.List; 5 4 import java.util.HashSet; 5 import java.util.Iterator; 6 import java.util.Set; 7 8 9 import schedframe.resources.computing.ComputingNode; 10 import schedframe.resources.computing.ComputingResource; 11 import schedframe.resources.computing.Core; 12 import schedframe.resources.computing.Processor; 13 import simulator.stats.implementation.out.StatsSerializer; 6 14 import dcworms.schedframe.scheduling.Executable; 7 8 import simulator.stats.implementation.out.StatsSerializer;9 15 10 16 /** … … 14 20 */ 15 21 public class TaskStats implements StatsInterface { 16 protected List<String> processorsName;22 protected Set<ComputingResource> processingElements; 17 23 protected double reservationStartDate; 18 24 protected double reservationFinishDate; … … 26 32 "ExecutionTime", "ReadyTime", "StartTime", "FlowTime", 27 33 "WaitingTime", "GQ_WaitingTime", "Lateness", "Tardiness", 28 "ReservStartDate", "ReservFinishDate", " ProcessorName", "Energy"};34 "ReservStartDate", "ReservFinishDate", "HostNames", "ProcessorName", "Energy", "AppName",}; 29 35 30 36 public TaskStats(Executable task, long startSimulationTime) { … … 147 153 } 148 154 149 public void setProcessors Name(List<String> value) {150 this.process orsName= value;155 public void setProcessors(Set<ComputingResource> value) { 156 this.processingElements = value; 151 157 } 152 158 … … 159 165 } 160 166 161 public List<String> getProcessorsName() { 162 return processorsName; 163 } 164 167 public Set<String> getProcessingElementsName() { 168 Set<String> processingElementsNames = new HashSet<String>(); 169 Iterator<ComputingResource> it = processingElements.iterator(); 170 while(it.hasNext()) { 171 ComputingResource compRes = it.next(); 172 processingElementsNames.add(compRes.getFullName()); 173 } 174 return processingElementsNames; 175 } 176 177 public Set<String> getHostName() { 178 Set<String> hostNames = new HashSet<String>(); 179 Iterator<ComputingResource> it = processingElements.iterator(); 180 while(it.hasNext()) { 181 ComputingResource compRes = it.next(); 182 ComputingNode node = null; 183 if(compRes instanceof Core){ 184 Core core =(Core) compRes; 185 node = (ComputingNode)core.getNode(); 186 } else if(compRes instanceof Processor){ 187 Processor proc = (Processor) compRes; 188 node = (ComputingNode)proc.getNode(); 189 } else if(compRes instanceof ComputingNode){ 190 node = (ComputingNode)compRes; 191 } 192 if(node != null) 193 hostNames.add(node.getFullName()); 194 } 195 return hostNames; 196 } 197 165 198 public double getReservationStartDate() { 166 199 return reservationStartDate; … … 170 203 return reservationFinishDate; 171 204 } 205 206 public String getExecName() { 207 String execName = null; 208 if(task.getDescription().getExecution() != null) { 209 if(task.getDescription().getExecution().getStdin()!= null && task.getDescription().getExecution().getStdin().length > 0) 210 execName = task.getDescription().getExecution().getStdin()[0].getName(); 211 else if(task.getDescription().getExecution().getExecutable() != null && task.getDescription().getExecution().getExecutable().getApplication() != null) 212 execName = task.getDescription().getExecution().getExecutable().getApplication().getName(); 213 } 214 return execName; 215 } 172 216 173 217 public String[] getHeaders() {
Note: See TracChangeset
for help on using the changeset viewer.