-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCloudletInfo.java
68 lines (48 loc) · 1.5 KB
/
CloudletInfo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package org.cloudbus.cloudsim.examples;
import org.cloudbus.cloudsim.Cloudlet;
public class CloudletInfo {
public int cloudletId;
public long cloudletLength;
public long cloudletFileSize;
public long cloudletOutputSize;
public int numberOfPes;
public String status;
public double execStartTime;
public double finishTime;
public CloudletInfo(Cloudlet cloudsimCloudlet) {
this.cloudletId = cloudsimCloudlet.getCloudletId();
this.cloudletLength = cloudsimCloudlet.getCloudletLength();
this.cloudletFileSize = cloudsimCloudlet.getCloudletFileSize();
this.cloudletOutputSize = cloudsimCloudlet.getCloudletOutputSize();
this.numberOfPes = cloudsimCloudlet.getNumberOfPes();
this.status = getStringStatus(cloudsimCloudlet.getStatus());
this.execStartTime = cloudsimCloudlet.getExecStartTime();
this.finishTime = cloudsimCloudlet.getFinishTime();
}
private String getStringStatus(int status) {
String returnStatus;
switch(status) {
case 0: returnStatus = "CREATED";
break;
case 1: returnStatus = "READY";
break;
case 2: returnStatus = "QUEUED";
break;
case 3: returnStatus = "INEXEC";
break;
case 4: returnStatus = "SUCCESS";
break;
case 5: returnStatus = "FAILED";
break;
case 6: returnStatus = "CANCELED";
break;
case 7: returnStatus = "PAUSED";
break;
case 8: returnStatus = "RESUMED";
break;
default: returnStatus = "UNDEFINED";
break;
}
return returnStatus;
}
}