1 package at.ac.tuwien.lsdc.types;
3 import java.math.BigDecimal;
4 import java.text.DecimalFormat;
6 import org.slf4j.Logger;
7 import org.slf4j.LoggerFactory;
9 public class ScenarioData {
11 private static final Logger LOG = LoggerFactory.getLogger(ScenarioData.class);
13 private String scheduler;
14 private String scenario;
15 private long totalPMs;
16 private long totalVMs;
17 private long totalDuration;
18 private double totalConsumption;
19 private int totalInSourced;
20 private int totalOutSourced;
21 private int totalResizeCalls;
22 private int totalDelayedApps;
23 private int totalStarted;
24 private int totalStopped;
26 public ScenarioData(String scheduler, String scenario, long totalPMs,
27 long totalVMs, long totalDuration, double totalConsumption,
28 int totalInSourced, int totalOutSourced,
29 int totalResizeCalls) {
30 this.scheduler = scheduler;
31 this.scenario = scenario;
32 this.totalPMs = totalPMs;
33 this.totalVMs = totalVMs;
34 this.totalDuration = totalDuration;
35 this.totalConsumption = totalConsumption;
36 this.totalInSourced = totalInSourced;
37 this.totalOutSourced = totalOutSourced;
38 this.totalResizeCalls = totalResizeCalls;
41 public ScenarioData(String scheduler, String scenario, long totalPMs,
42 long totalVMs, long totalDuration, double totalConsumption,
43 int totalInSourced, int totalOutSourced,
44 int totalResizeCalls, int totalDelayedApps) {
46 this(scheduler, scenario, totalPMs, totalVMs, totalDuration, totalConsumption, totalInSourced, totalOutSourced, totalResizeCalls);
47 this.totalDelayedApps = totalDelayedApps;
50 public ScenarioData(String scheduler, String scenario, long totalPMs,
51 long totalVMs, long totalDuration, double totalConsumption,
52 int totalInSourced, int totalOutSourced,
53 int totalResizeCalls, int totalDelayedApps,
54 int totalStarted, int totalStopped) {
56 this(scheduler, scenario, totalPMs, totalVMs, totalDuration, totalConsumption, totalInSourced,
57 totalOutSourced, totalResizeCalls, totalDelayedApps);
58 this.totalStarted = totalStarted;
59 this.totalStopped = totalStopped;
62 public String[] toStringArray() {
63 // LOG.info("total Consumption = "+totalConsumption+ ", string: "+String.valueOf(totalConsumption));
64 DecimalFormat df = new DecimalFormat("#.##");
66 return new String[] { scheduler, scenario, String.valueOf(totalPMs), String.valueOf(totalVMs),
67 String.valueOf(totalDuration), df.format(totalConsumption), String.valueOf(totalInSourced),
68 String.valueOf(totalOutSourced), String.valueOf(totalResizeCalls), String.valueOf(totalDelayedApps) ,
69 String.valueOf(totalStarted), String.valueOf(totalStopped) };
73 public String toString() {
74 return "ScenarioData [scheduler=" + scheduler + ", scenario="
75 + scenario + ", totalPMs=" + totalPMs + ", totalVMs="
76 + totalVMs + ", totalDuration=" + totalDuration
77 + ", totalConsumption=" + totalConsumption
78 + ", totalInSourced=" + totalInSourced + ", totalOutSourced="
79 + totalOutSourced + ", totalResizeCalls=" + totalResizeCalls
80 + ", delayedApps=" + totalDelayedApps
81 + ", totalStarted=" + totalStarted + "totalStopped=" + totalStopped + "]";