Ignore:
Timestamp:
03/19/14 18:22:27 (11 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java

    r1207 r1299  
    6262import schedframe.resources.UserResourceType; 
    6363import schedframe.resources.computing.ComputingResource; 
     64import schedframe.resources.computing.Processor; 
    6465import schedframe.resources.computing.extensions.Extension; 
    6566import schedframe.resources.computing.extensions.ExtensionList; 
    6667import schedframe.resources.computing.extensions.ExtensionType; 
    6768import schedframe.resources.computing.profiles.energy.EnergyExtension; 
     69import schedframe.resources.computing.profiles.energy.MeasurementHistory; 
    6870import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue; 
    6971import schedframe.resources.computing.profiles.energy.power.PowerUsage; 
    7072import schedframe.resources.computing.profiles.energy.thermal.TemperatureValue; 
     73import schedframe.resources.computing.profiles.load.LoadExtension; 
    7174import schedframe.resources.devices.Device; 
    7275import schedframe.resources.devices.PhysicalResource; 
     
    8588import simulator.DataCenterWorkloadSimulator; 
    8689import simulator.GenericUser; 
     90import simulator.stats.CoolEmAllMetricsCalculator; 
     91import simulator.stats.DCwormsMetricsCalculator; 
    8792import simulator.stats.GSSAccumulator; 
    8893import simulator.stats.MetricsCalculator; 
    8994import simulator.stats.SimulationStatistics; 
    90 import simulator.stats.implementation.out.AbstractStringSerializer; 
    9195import simulator.stats.implementation.out.CoolEmAllStringSerializer; 
    9296import simulator.stats.implementation.out.StringSerializer; 
     
    110114        protected static final int MILLI_SEC = 1000; 
    111115 
    112         protected static final String RAW_TASKS_STATISTICS_OUTPUT_FILE_NAME = "Tasks.txt"; 
     116        protected static final String TASKS_STATISTICS_OUTPUT_FILE_NAME = "Tasks.txt"; 
    113117        protected static final String JOBS_STATISTICS_OUTPUT_FILE_NAME = "Jobs.txt"; 
    114118 
    115119        protected static final String SIMULATION_STATISTICS_OUTPUT_FILE_NAME = "Simulation.txt"; 
     120        protected static final String RESOURCEOCCUPANCY_STATISTICS_OUTPUT_FILE_NAME = "ResourceOccupancy.txt"; 
    116121        protected static final String RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.txt"; 
    117122        protected static final String ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "EnergyUsage.txt"; 
     
    141146        protected SimulatedEnvironment resourceController; 
    142147        protected boolean generateDiagrams = true; 
    143         protected AbstractStringSerializer serializer; 
     148        protected StringSerializer serializer; 
    144149        protected long startSimulationTime; 
    145150        protected long endSimulationTime; 
    146151         
    147152        //RESOURCES 
    148         protected Map<String, List<ResStat>> basicResStats; 
     153        protected Map<String, List<ResStat>> pesStats; 
    149154        protected Map<String, Double> basicResLoad; 
    150155         
     
    156161        protected Map<String, List<XYDataset>> resourceAirFlowDiagrams; 
    157162        protected Map<String, List<XYDataset>> resourceTemperatureDiagrams; 
    158         protected Map<String, List<XYDataset>> resourceLoadDiagrams; 
     163        protected Map<String, List<XYDataset>> resourceOccupancyDiagrams; 
     164        protected Map<String, List<XYDataset>> resourceUtilizationDiagrams; 
    159165         
    160166        //TASKS 
     
    178184 
    179185                this.outputFolderName = outputFolderName; 
    180  
    181                 this.serializer = new StringSerializer(); 
    182                  
    183                 if(DataCenterWorkloadSimulator.MODE.equals("CoolEmAll")){ 
    184                         this.serializer = new CoolEmAllStringSerializer();       
    185                 } 
    186                 this.serializer.setDefaultNumberFormat(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT); 
    187  
    188186                this.resourceController = resourceController; 
    189187                this.jr = new JobRegistryImpl(""); 
    190                 init(); 
    191                 metCalc = new MetricsCalculator(); 
    192         } 
    193  
    194         public void generateStatistics() { 
    195  
     188                 
    196189                if(users.isSimStartTimeDefined()) 
    197190                        this.startSimulationTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis(); 
    198191                else 
    199192                        this.startSimulationTime = new DateTime(users.getSubmissionStartTime() * 1000l).getMillis(); 
     193                 
    200194                this.endSimulationTime = DateTimeUtilsExt.currentTimeMillis(); 
    201195 
    202                 metCalc.setStartTime(startSimulationTime); 
    203                 metCalc.setEndTime(endSimulationTime); 
     196                init(); 
     197        } 
     198 
     199        public void generateStatistics() { 
    204200                 
    205201                long s = 0; 
     
    234230                accStats = new GSSAccumulatorsStats(); 
    235231                statsData = new HashMap<String, GSSAccumulator>(); 
     232                 
     233                this.serializer = new StringSerializer();                
     234                this.metCalc =  new DCwormsMetricsCalculator(startSimulationTime, endSimulationTime, endSimulationTime); 
     235                 
     236                if(DataCenterWorkloadSimulator.MODE.equals("CoolEmAll")){ 
     237                        this.serializer = new CoolEmAllStringSerializer(); 
     238                        this.metCalc = new CoolEmAllMetricsCalculator(startSimulationTime, endSimulationTime, endSimulationTime); 
     239                } 
     240                this.serializer.setDefaultNumberFormat(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT); 
    236241        } 
    237242 
     
    262267                        System.out.println("#STATS " + "===== Performance statistics ====="); 
    263268                        System.out.println("#STATS " + "Makespan: " + df.format(accStats.makespan.getMean()) + " [s]"); 
    264                         System.out.println("#STATS " + "Task completion time - " + "min: " + df.format(accStats.meanTaskCompletionTime.getMin()) + " [s]" + "; max: " + df.format(accStats.meanTaskCompletionTime.getMax()) + " [s]"); 
     269                        System.out.println("#STATS " + "Task completion time - " + "min: " + df.format(accStats.meanTaskCompletionTime.getMin()) + " [s]" + "; max: " + df.format(accStats.meanTaskCompletionTime.getMax()) + " [s]" + "; mean: " + df.format(accStats.meanTaskCompletionTime.getMean()) + " [s]"); 
    265270                        System.out.println("#STATS " + "Mean task execution time: " + df.format(accStats.meanTaskExecutionTime.getMean()) + " [s]"); 
     271                        System.out.println("#STATS " + "System occupancy: " + df.format(accStats.meanTotalOccupancy.getMean() * 100) + " [%]"); 
    266272                        System.out.println("#STATS " + "System load: " + df.format(accStats.meanTotalLoad.getMean() * 100) + " [%]"); 
     273                         
    267274                         
    268275                        simulationStatsFile.println(txt); 
     
    300307                taskGanttMap = new HashMap<String, TimetableEventGroup>();               
    301308                 
    302                 resourceLoadDiagrams = new HashMap<String, List<XYDataset>>(); 
     309                resourceOccupancyDiagrams = new HashMap<String, List<XYDataset>>(); 
     310                resourceUtilizationDiagrams = new HashMap<String, List<XYDataset>>(); 
    303311                resourcePowerUsageDiagrams = new HashMap<String, List<XYDataset>>(); 
    304312                resourceAirFlowDiagrams = new HashMap<String, List<XYDataset>>(); 
     
    309317                 
    310318                 
    311                 PrintStream resourceLoadStatsFile = null; 
     319                PrintStream resourceOccupancyStatsFile = null; 
     320                try { 
     321                        File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX 
     322                                        + simulationIdentifier + "_" 
     323                                        + RESOURCEOCCUPANCY_STATISTICS_OUTPUT_FILE_NAME); 
     324                        resourceOccupancyStatsFile = new PrintStream(new FileOutputStream(file)); 
     325                } catch (IOException e) { 
     326                        resourceOccupancyStatsFile = null; 
     327                } 
     328                 
     329                PrintStream resourceUtilizationStatsFile = null; 
    312330                try { 
    313331                        File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX 
    314332                                        + simulationIdentifier + "_" 
    315333                                        + RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME); 
    316                         resourceLoadStatsFile = new PrintStream(new FileOutputStream(file)); 
     334                        resourceUtilizationStatsFile = new PrintStream(new FileOutputStream(file)); 
    317335                } catch (IOException e) { 
    318                         resourceLoadStatsFile = null; 
     336                        resourceUtilizationStatsFile = null; 
    319337                } 
    320338                 
     
    389407                } 
    390408                 
    391                 basicResStats = gatherPEStats(jr.getTasks()); 
    392                 peStatsPostProcessing(basicResStats); 
    393                 basicResLoad = calculatePELoad( basicResStats); 
     409                pesStats = gatherPEStats(jr.getTasks()); 
     410                peStatsPostProcessing(pesStats); 
     411                basicResLoad = calculatePELoad(pesStats); 
    394412 
    395413                if (configuration.creatediagrams_gantt) { 
    396                         createPEGanttDiagram(basicResStats); 
     414                        createPEGanttDiagram(pesStats); 
    397415                } 
    398416                 
     
    412430                                 
    413431                                for(ComputingResource compResource: compResources){ 
    414                                         ResourceUsageStats resourceUsage = null; 
     432                                        ResourceUsageStats resourceUtilization = null;                                   
     433                                        ResourceUsageStats resourceOccupancy = null; 
    415434                                        ResourcePowerStats energyUsage = null; 
    416435                                        ResourceAirFlowStats airFlow = null; 
     
    418437                                        ResourceUsefulWorkStats usefulWork = null; 
    419438                                        if(type_stats.get(resourceTypeName).contains(Stats.textLoad)){ 
    420                                                 resourceUsage = gatherResourceLoadStats(compResource, basicResStats); 
    421                                                 resourceUsage.setMeanValue(calculateMeanValue(resourceUsage)); 
    422                                                 if (resourceLoadStatsFile != null) { 
    423                                                         Object txt = resourceUsage.serialize(serializer); 
    424                                                         resourceLoadStatsFile.print(txt); 
     439                                                resourceOccupancy = gatherResourceOccupancyStats(compResource, pesStats); 
     440                                                resourceOccupancy.setMeanValue(calculateMeanValue(resourceOccupancy)); 
     441                                                if (resourceOccupancyStatsFile != null) { 
     442                                                        Object txt = resourceOccupancy.serialize(serializer); 
     443                                                        resourceOccupancyStatsFile.print(txt); 
    425444                                                } 
    426  
     445                                                 
     446                                                resourceUtilization = gatherResourceUtlizationStats(compResource); 
     447                                                resourceUtilization.setMeanValue(calculateMeanValue(resourceUtilization)); 
     448                                                if (resourceUtilizationStatsFile != null) { 
     449                                                        Object txt = resourceUtilization.serialize(serializer); 
     450                                                        resourceUtilizationStatsFile.print(txt); 
     451                                                } 
    427452                                        } 
    428453                                        if(type_stats.get(resourceTypeName).contains(Stats.chartLoad)){ 
    429454                                                if (configuration.creatediagrams_resutilization) { 
    430                                                         createResourceLoadDiagram(resourceUsage); 
     455                                                        createResourceOccupancyDiagram(resourceOccupancy); 
     456                                                        createResourceUtilizationDiagram(resourceUtilization); 
    431457                                                } 
    432458                                        } 
     
    437463                                                resourceEnergyAccumulator.add(energyUsage.getSumValue()); 
    438464                                                maxResourceEnergyAccumulator.add(calculateMaxValue(energyUsage)); 
    439                                                 double calulcationsEnergy = 0; 
     465                                                double calculationsEnergy = 0; 
    440466                                                try { 
    441                                                         /*boolean doCalc = false; 
    442                                                         double prevTimestamp = 0; 
    443                                                         for(Long key: resourceUsage.getHistory().keySet()){ 
    444                                                                 if(doCalc){ 
    445                                                                         System.out.println(energyUsage.getHistory().get(key)); 
    446                                                                         calulcationsEnergy = calulcationsEnergy + energyUsage.getHistory().get(prevTimestamp) * (key - prevTimestamp) /(3600 * MILLI_SEC); 
    447                                                                         doCalc  = false; 
    448                                                                 } 
    449                                                                 if(resourceUsage.getHistory().get(key)>0){ 
    450                                                                         prevTimestamp = key; 
    451                                                                         doCalc = true; 
    452                                                                 } 
    453                                                         }*/ 
    454467                                                        boolean doCalc = false; 
     468                                                        double load = 0; 
    455469                                                        long prevTimestamp = 0; 
    456470                                                        for(Long key: energyUsage.getHistory().keySet()){ 
    457471                                                                if(doCalc){ 
    458                                                                         double load = 0; 
    459                                                                         if(resourceUsage.getHistory().get(prevTimestamp)!= null){ 
    460                                                                                 load = resourceUsage.getHistory().get(prevTimestamp); 
     472                                                                        if(resourceTypeName.equals("Rack")){ 
     473                                                                                calculationsEnergy = calculationsEnergy + CoolEmAllTestbedMeasurements.OTHER_DEVICES_POWER_CONSUMPTION * (key - prevTimestamp) /(3600.0 * MILLI_SEC); 
     474                                                                        }/* else if(resourceTypeName.equals("Processor")){ 
     475                                                                                Processor proc =( Processor) compResource; 
     476                                                                                double maxPower = proc.getPowerInterface().getLowestPState().getLoadPowerUsage().get(100.0); 
     477                                                                                calculationsEnergy = calculationsEnergy + load * maxPower * (key - prevTimestamp) /(3600.0 * MILLI_SEC); 
     478                                                                        }*/ 
     479                                                                        else  
     480                                                                                calculationsEnergy = calculationsEnergy + load * energyUsage.getHistory().get(prevTimestamp) * (key - prevTimestamp) /(3600.0 * MILLI_SEC); 
     481                                                                        doCalc = false; 
     482                                                                        load = 0; 
     483                                                                } 
     484                                                                 
     485                                                                if(resourceUtilization.getHistory().get(key) != null){ 
     486                                                                        load = resourceUtilization.getHistory().get(key); 
     487                                                                        if(load > 0 ){ 
     488                                                                                doCalc = true; 
     489                                                                                prevTimestamp = key; 
    461490                                                                        } 
    462                                                                         calulcationsEnergy = calulcationsEnergy + load * energyUsage.getHistory().get(prevTimestamp) * (key - prevTimestamp) /(3600.0 * MILLI_SEC); 
    463                                                                         doCalc = false; 
    464                                                                 } 
    465                                                                 if(energyUsage.getHistory().get(key) > compResource.getPowerInterface().getSupportedPowerStates().get(0).getPowerUsage() - CoolEmAllTestbedMeasurements.SINGLE_FAN_ON_POWER_CONSUMPTION){ 
    466                                                                          
    467                                                                         prevTimestamp = key; 
    468                                                                         doCalc = true; 
    469491                                                                } 
    470492                                                        } 
    471                                                         //calulcationsEnergy = energyUsage.getSumValue() -  
    472                                                         //      ((1 - resourceUsage.getMeanValue()) * (endSimulationTime - startSimulationTime) / (3600 * MILLI_SEC)) *  
    473                                                         //      (compResource.getPowerInterface().getSupportedPowerStates().get(0).getPowerUsage() - CoolEmAllTestbedMeasurements.SINGLE_FAN_ON_POWER_CONSUMPTION); 
    474                                                         //System.out.println(compResource.getFullName() + ";" + resourceUsage.getMeanValue() +":"+ calulcationsEnergy  + ":" + energyUsage.getSumValue()); 
    475                                                         calculationsEnergyAccumulator.add(calulcationsEnergy); 
     493 
     494                                                        calculationsEnergyAccumulator.add(calculationsEnergy); 
    476495                                                } catch (Exception e) { 
    477496                                                        e.printStackTrace(); 
     
    510529                                                        devAccumulator.add(deviceEnergyUsage.getSumValue()); 
    511530                                                        metCalc.addMetricsData(device.getType().getName(), devAccumulator); 
     531                                                        metCalc.addMetricsData(device.getFullName(), devAccumulator); 
    512532                                                        if (deviceStatsFile != null) { 
    513533                                                                Object txt = deviceEnergyUsage.serialize(serializer); 
     
    666686                        //log.info("#STATS " + "Metrics"); 
    667687                        System.out.println("#STATS " + "===== Metrics ====="); 
    668                         for(MetricsStats metric: metCalc.calulateMetrics(endSimulationTime)){ 
     688                        for(MetricsStats metric: metCalc.calulateMetrics()){ 
    669689                                Object txt = metric.serialize(serializer); 
    670690                                //log.info("#STATS " +  metric.getResourceName() + " " + metric.getMetricName() + ": " + metric.getValue()); 
     
    676696                        } 
    677697                } 
    678                 saveResourceUsageDiagrams(); 
     698                saveResourceDiagrams(); 
    679699                createAccumulatedResourceSimulationStatistic(); 
    680700                 
     
    688708                        energyStatsFile.close(); 
    689709                } 
    690                 if (resourceLoadStatsFile != null) { 
    691                         resourceLoadStatsFile.close(); 
     710                if (resourceOccupancyStatsFile != null) { 
     711                        resourceOccupancyStatsFile.close(); 
     712                } 
     713                if (resourceUtilizationStatsFile != null) { 
     714                        resourceUtilizationStatsFile.close(); 
    692715                } 
    693716                 
     
    813836         
    814837         
    815         private ResourceUsageStats gatherResourceLoadStats(ComputingResource resource, Map<String, List<ResStat>> basicStats) { 
     838        private ResourceUsageStats gatherResourceOccupancyStats(ComputingResource resource, Map<String, List<ResStat>> basicStats) { 
    816839                String usageType = null; 
    817840                if(resource.getResourceCharacteristic().getParameters().get("load-sensor")!= null){ 
     
    844867                int usedResources = 0; 
    845868                for(ComputingResource compResource: resource.getChildren()){ 
    846                         double meanLoad = calculateMeanValue(gatherResourceLoadStats(compResource, basicResStats)); 
     869                        double meanLoad = calculateMeanValue(gatherResourceOccupancyStats(compResource, pesStats)); 
    847870                        if(meanLoad > 0){ 
    848871                                usedResources++; 
     
    916939        } 
    917940         
     941        private ResourceUsageStats gatherResourceUtlizationStats(PhysicalResource resource) { 
     942                 
     943                String usageType = null; 
     944                if(resource.getResourceCharacteristic().getParameters().get("load-sensor")!= null){ 
     945                        usageType = resource.getResourceCharacteristic().getParameters().get("load-sensor").get(0).getContent(); 
     946                } 
     947                ResourceUsageStats resUtlization = new ResourceUsageStats(resource.getFullName(), resource.getType(), usageType); 
     948                Map<Long, Double> usage = resUtlization.getHistory(); 
     949                 
     950                ExtensionList extensionList = resource.getExtensionList(); 
     951                if(extensionList != null){ 
     952                        for (Extension extension : extensionList) { 
     953                                if (extension.getType() == ExtensionType.LOAD_EXTENSION) { 
     954                                        LoadExtension le = (LoadExtension)extension; 
     955                                        if(le.getLoadProfile() == null) 
     956                                                break; 
     957                                        List<MeasurementHistory> loadHistory = le.getLoadProfile().getUtilizationHistory(); 
     958                                        if(loadHistory.size() == 0) 
     959                                                break; 
     960                                        long endSimulationTime = DateTimeUtilsExt.currentTimeMillis(); 
     961 
     962                                        loadHistory.add(new MeasurementHistory(endSimulationTime, le.getLoadProfile().getUtilizationHistory().get(le.getLoadProfile().getUtilizationHistory().size() - 1).getValue()/100)); 
     963                                        for(MeasurementHistory l:loadHistory){ 
     964                                                usage.put(l.getTimestamp(), l.getValue()/100); 
     965                                        } 
     966                                } 
     967                        } 
     968                } 
     969                return resUtlization; 
     970        } 
    918971         
    919972        private ResourcePowerStats gatherResourcePowerConsumptionStats(PhysicalResource resource) { 
     
    921974                 
    922975                String usageType = null; 
    923                 if(resource.getResourceCharacteristic().getParameters().get("power-sensor")!= null){ 
     976                if(resource.getResourceCharacteristic().getParameters().get("power-sensor") != null){ 
    924977                        usageType = resource.getResourceCharacteristic().getParameters().get("power-sensor").get(0).getContent(); 
    925978                } 
     
    9541007        } 
    9551008         
    956          
    9571009        private ResourceAirFlowStats gatherResourceAirFlowStats(PhysicalResource resource) { 
    9581010 
    9591011                String usageType = null; 
    960                 if(resource.getResourceCharacteristic().getParameters().get("airflow_volume-sensor")!= null){ 
     1012                if(resource.getResourceCharacteristic().getParameters().get("airflow_volume-sensor") != null){ 
    9611013                        usageType = resource.getResourceCharacteristic().getParameters().get("airflow_volume-sensor").get(0).getContent(); 
    9621014                } 
     
    10161068        } 
    10171069         
    1018         private void createResourceLoadDiagram(ResourceUsageStats resLoadStats) { 
     1070        private void createResourceOccupancyDiagram(ResourceUsageStats resLoadStats) { 
    10191071 
    10201072                for(Long key: resLoadStats.getHistory().keySet()){ 
     
    10261078                                startSimulationTime, endSimulationTime); 
    10271079 
    1028                 List<XYDataset> loadDiagram = resourceLoadDiagrams.get(resLoadStats.getResourceType().getName()); 
    1029                 if(loadDiagram == null){ 
    1030                         loadDiagram = new ArrayList<XYDataset>(); 
    1031                         loadDiagram.add(dataset); 
    1032                         resourceLoadDiagrams.put(resLoadStats.getResourceType().getName(), loadDiagram); 
     1080                List<XYDataset> occupancyDiagram = resourceOccupancyDiagrams.get(resLoadStats.getResourceType().getName()); 
     1081                if(occupancyDiagram == null){ 
     1082                        occupancyDiagram = new ArrayList<XYDataset>(); 
     1083                        occupancyDiagram.add(dataset); 
     1084                        resourceOccupancyDiagrams.put(resLoadStats.getResourceType().getName(), occupancyDiagram); 
    10331085                } else { 
    1034                         loadDiagram.add(dataset); 
     1086                        occupancyDiagram.add(dataset); 
     1087                } 
     1088        } 
     1089         
     1090        private void createResourceUtilizationDiagram(ResourceUsageStats resLoadStats) { 
     1091 
     1092                for(Long key: resLoadStats.getHistory().keySet()){ 
     1093                        Double value = resLoadStats.getHistory().get(key) * 100; 
     1094                        resLoadStats.getHistory().put(key, value); 
     1095                } 
     1096                 
     1097                XYDataset dataset = createResourceChartDataSet(resLoadStats, 
     1098                                startSimulationTime, endSimulationTime); 
     1099 
     1100                List<XYDataset> utilizationDiagram = resourceUtilizationDiagrams.get(resLoadStats.getResourceType().getName()); 
     1101                if(utilizationDiagram == null){ 
     1102                        utilizationDiagram = new ArrayList<XYDataset>(); 
     1103                        utilizationDiagram.add(dataset); 
     1104                        resourceUtilizationDiagrams.put(resLoadStats.getResourceType().getName(), utilizationDiagram); 
     1105                } else { 
     1106                        utilizationDiagram.add(dataset); 
    10351107                } 
    10361108        } 
     
    11091181        } 
    11101182 
    1111         private boolean saveResourceUsageDiagrams() { 
     1183        private boolean saveResourceDiagrams() { 
    11121184 
    11131185                if (!generateDiagrams) 
     
    11331205                chartName = "Load diagram for " 
    11341206                        + DataCenterWorkloadSimulator.SIMULATOR_NAME; 
    1135                 JFreeChart resourceLoadDiagram = null; 
     1207                JFreeChart resourceOccupancyDiagram = null; 
     1208                if (configuration.creatediagrams_resutilization) { 
     1209                        String axisName = "OCCUPANCY [%]"; 
     1210                        for(String resType: resourceOccupancyDiagrams.keySet()){ 
     1211                                resourceOccupancyDiagram = getResourceDynamicDiagram(resourceOccupancyDiagrams.get(resType), simulationTime, chartName, 
     1212                                                subtitle, axisName); 
     1213                                if (!saveXYPlotChart(resourceOccupancyDiagram, fileName + "ResourcesOccupancy_" + resType)) 
     1214                                        return false; 
     1215                        } 
     1216                } 
     1217                 
     1218                chartName = "Utilization diagram for " 
     1219                        + DataCenterWorkloadSimulator.SIMULATOR_NAME; 
     1220                JFreeChart resourceUtilizationDiagram = null; 
    11361221                if (configuration.creatediagrams_resutilization) { 
    11371222                        String axisName = "UTILIZATION [%]"; 
    1138                         for(String resType: resourceLoadDiagrams.keySet()){ 
    1139                                 resourceLoadDiagram = getResourceDynamicDiagram(resourceLoadDiagrams.get(resType), simulationTime, chartName, 
     1223                        for(String resType: resourceUtilizationDiagrams.keySet()){ 
     1224                                resourceUtilizationDiagram = getResourceDynamicDiagram(resourceUtilizationDiagrams.get(resType), simulationTime, chartName, 
    11401225                                                subtitle, axisName); 
    1141                                 if (!saveXYPlotChart(resourceLoadDiagram, fileName + "ResourcesLoad_" + resType)) 
     1226                                if (!saveXYPlotChart(resourceUtilizationDiagram, fileName + "ResourcesUtilization_" + resType)) 
    11421227                                        return false; 
    11431228                        } 
     
    13221407                                //double load = calculateMeanValue(resourceUsage); 
    13231408                                double load = calculateResourceLoad(compRes, basicResLoad); 
    1324                                 accStats.meanTotalLoad.add(load); 
     1409                                accStats.meanTotalOccupancy.add(load); 
     1410 
     1411                                ResourceUsageStats resourceUtilization = gatherResourceUtlizationStats(compRes); 
     1412                                accStats.meanTotalLoad.add(calculateMeanValue(resourceUtilization)); 
    13251413                                /*ResourceEnergyStats energyUsage = gatherResourceEnergyStats(compRes); 
    13261414                                energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage)); 
     
    13651453 
    13661454         
    1367         private double calculateMeanValue(ResourceDynamicStats resDynamicStats ){ 
     1455        private double calculateMeanValue(ResourceDynamicStats resDynamicStats){ 
    13681456                double meanValue = 0; 
    13691457                long time = -1; 
     
    13871475         
    13881476         
    1389         private double calculateMaxValue(ResourceDynamicStats resDynamicStats ){ 
     1477        private double calculateMaxValue(ResourceDynamicStats resDynamicStats){ 
    13901478                double maxValue = 0; 
    13911479 
     
    14141502                try { 
    14151503                        File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX + simulationIdentifier + "_" 
    1416                                         + RAW_TASKS_STATISTICS_OUTPUT_FILE_NAME); 
     1504                                        + TASKS_STATISTICS_OUTPUT_FILE_NAME); 
    14171505                        taskStatsFile = new PrintStream(new FileOutputStream(file)); 
    14181506                } catch (IOException e) { 
     
    16341722                chartName = "Task waiting times diagram for " + DataCenterWorkloadSimulator.SIMULATOR_NAME; 
    16351723                if (configuration.creatediagrams_taskswaitingtime) { 
    1636                         waitingTimeDiagram = getWaitingTimeDiagram(chartName, subtitle, simulationTime); 
     1724                        waitingTimeDiagram = getTaskWaitingTimeDiagram(chartName, subtitle, simulationTime); 
    16371725                        if (!saveCategoryChart(waitingTimeDiagram, fileName + "Waiting_Time", null /* "Task {1} at {0}" */)) 
    16381726                                return false; 
     
    16551743        } 
    16561744 
    1657         private JFreeChart getWaitingTimeDiagram(String chartName, Title subtitle, String simulationTime) { 
     1745        private JFreeChart getTaskWaitingTimeDiagram(String chartName, Title subtitle, String simulationTime) { 
    16581746                String tasks = "Tasks"; 
    16591747                boolean urls = false; 
     
    18781966        textTemperature, 
    18791967        chartTemperature, 
    1880         textUsefulWorl; 
     1968        textUsefulWork; 
    18811969} 
Note: See TracChangeset for help on using the changeset viewer.