- Timestamp:
- 11/30/12 13:24:51 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java
r544 r687 50 50 import org.jfree.data.xy.XYSeriesCollection; 51 51 import org.jfree.ui.TextAnchor; 52 import org.joda.time.DateTime; 52 53 import org.joda.time.DateTimeUtilsExt; 53 54 … … 173 174 public void generateStatistics() { 174 175 175 this.startSimulationTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis(); 176 if(users.isSimStartTimeDefined()) 177 this.startSimulationTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis(); 178 else 179 this.startSimulationTime = new DateTime(users.getSubmissionStartTime() * 1000l).getMillis(); 176 180 this.endSimulationTime = DateTimeUtilsExt.currentTimeMillis(); 177 181 … … 204 208 205 209 private void init() { 206 207 210 task_processorsMap = new HashMap<String, List<String>>(); 208 211 accStats = new GSSAccumulatorsStats(); … … 683 686 XYSeriesCollection dataset = new XYSeriesCollection(); 684 687 XYSeries data = new XYSeries(dynamicStats.getResourceName(), false, true); 685 //data.add(start, 0);688 data.add(start, 0); 686 689 for (Long key : chartData.keySet()) { 687 690 Double val = chartData.get(key); 688 data.add(key, val); 691 if(key >= startSimulationTime) 692 data.add(key, val); 689 693 } 690 694 data.add(end, 0); … … 726 730 return false; 727 731 } 728 732 chartName = "Load diagram for " 733 + DataCenterWorkloadSimulator.SIMULATOR_NAME; 729 734 JFreeChart resourceLoadDiagram = null; 730 735 if (configuration.creatediagrams_resutilization) { … … 738 743 } 739 744 745 chartName = "Energy usage diagram for " 746 + DataCenterWorkloadSimulator.SIMULATOR_NAME; 740 747 JFreeChart resourceEnergyDiagram = null; 741 748 if (configuration.creatediagrams_respowerusage) { … … 749 756 } 750 757 758 chartName = "Air flow diagram for " 759 + DataCenterWorkloadSimulator.SIMULATOR_NAME; 751 760 JFreeChart resourceAirFlowDiagram = null; 752 761 if (configuration.creatediagrams_resairflow) { … … 923 932 private double calculateMeanValue(ResourceDynamicStats resDynamicStats ){ 924 933 double meanValue = 0; 925 long time = 0;934 long time = -1; 926 935 double value = 0; 927 936 … … 929 938 for (Long key : history.keySet()) { 930 939 931 if (time != 0) { 932 meanValue += (value * (key - time)) / (endSimulationTime - startSimulationTime); 933 time = key; 934 } else { 935 time = key; 940 if(key >= startSimulationTime){ 941 if (time != -1) { 942 meanValue += (value * (key - time)) / (endSimulationTime - startSimulationTime); 943 time = key; 944 } else { 945 time = key; 946 } 936 947 } 937 948 value = history.get(key); … … 1167 1178 .getAbsolutePath(); 1168 1179 1169 String chartName = " Ganttdiagram for " + DataCenterWorkloadSimulator.SIMULATOR_NAME;1180 String chartName = "Task diagram for " + DataCenterWorkloadSimulator.SIMULATOR_NAME; 1170 1181 String simulationTime = "Simulation time"; 1171 1182 Title subtitle = new TextTitle("created for \"" + simulationIdentifier + "\" at " … … 1178 1189 } 1179 1190 1191 chartName = "Task waiting times diagram for " + DataCenterWorkloadSimulator.SIMULATOR_NAME; 1180 1192 if (configuration.creatediagrams_taskswaitingtime) { 1181 1193 waitingTimeDiagram = getWaitingTimeDiagram(chartName, subtitle, simulationTime);
Note: See TracChangeset
for help on using the changeset viewer.