Class SwfWorkloadFileReader
java.lang.Object
org.cloudsimplus.traces.FileReader
org.cloudsimplus.traces.TraceReaderAbstract
org.cloudsimplus.traces.SwfWorkloadFileReader
- All Implemented Interfaces:
TraceReader
Reads resource traces and creates a list of (Cloudlets) (jobs).
It follows the Standard Workload Format (*.swf files)
from The Hebrew University of Jerusalem.
Check important details at TraceReaderAbstract.
NOTES
- The default Cloudlet reader size for sending to and receiving from a Datacenter is
DataCloudTags.DEFAULT_MTU. However, you can specify the reader size by usingCloudlet.setFileSize(long). - A job run time considers the time spent for a single PE (since all PEs will be used for the same amount of time)not not the total execution time across all PEs. For example, job #1 in the trace has a run time of 100 seconds for 2 processors. This means each processor runs job #1 for 100 seconds if the processors have the same specification.
List of unused fields
- Required running time (index 8): This can be either runtime (measured in wall-clock seconds), or average CPU time per processor (also in seconds). The exact meaning is determined by a header comment. If a log contains a request for total CPU time, it is divided by the number of requested processors.
- User who submitted the job (index 11)
- Group of the user who submitted the job (index 12)
- Author:
- Anthony Sulistio, Marcos Dias de Assuncao, Manoel Campos da Silva Filho
- See Also:
-
Field Summary
Fields inherited from class org.cloudsimplus.traces.FileReader
DEF_FIELD_DELIMITER_REGEXFields inherited from interface org.cloudsimplus.traces.TraceReader
LOGGER -
Constructor Summary
ConstructorsConstructorDescriptionSwfWorkloadFileReader(@NonNull String filePath, int mips) Create a SwfWorkloadFileReader object. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of Cloudlet representing jobs to be executed.static SwfWorkloadFileReadergetInstance(String fileName, int mips) Returns a newSwfWorkloadFileReaderinstance from a workload file.setMips(int mips) Sets the MIPS capacity of the PEs from the VM where each created Cloudlet is supposed to run.Methods inherited from class org.cloudsimplus.traces.TraceReaderAbstract
getFieldDoubleValue, getFieldDoubleValue, getFieldIntValue, getFieldIntValue, getFieldLongValue, getFieldLongValue, getFieldValue, getLastParsedLineArray, setLastParsedLineArrayMethods inherited from class org.cloudsimplus.traces.FileReader
getCommentString, getSingleLineReader, readFile, readFile, setCommentString, setMaxLinesToReadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudsimplus.traces.TraceReader
getCommentString, getFieldDelimiterRegex, getFilePath, getLastLineNumber, getMaxLinesToRead, setCommentString, setFieldDelimiterRegex, setMaxLinesToRead
-
Constructor Details
-
SwfWorkloadFileReader
Create a SwfWorkloadFileReader object.- Parameters:
filePath- the workload trace file path in one of the following formats: ASCII text, zip, gz.mips- the MIPS capacity of the PEs from the VM where each created Cloudlet is supposed to run. Consider the workload reader provides the run time for each application registered inside the reader. The MIPS value will be used to compute the length of the Cloudlet (in MI) so that it's expected to execute inside the VM with the given MIPS capacity, at the same time as specified into the workload reader.- Throws:
IllegalArgumentException- when the workload trace file name is null or empty; or the resource PE mips is less or equal to 0FileNotFoundException- when the file is not found- See Also:
-
-
Method Details
-
getInstance
Returns a newSwfWorkloadFileReaderinstance from a workload file. inside the application's resource directory. Use the available constructors if you want to load a file outside the resource directory.- Parameters:
fileName- the workload trace relative file name in one of the following formats: ASCII text, zip, gz.mips- the MIPS capacity of the PEs from the VM where each created Cloudlet is supposed to run. Consider the workload reader provides the run time for each application registered inside the reader. The MIPS value will be used to compute the length of the Cloudlet (in MI) so that it's expected to execute inside the VM with the given MIPS capacity, at the same time as specified into the workload reader.- Returns:
- a new
SwfWorkloadFileReaderinstance from a workload file - Throws:
IllegalArgumentException- when the workload trace file name is null or empty; or the resource PE mips is less or equal to 0UncheckedIOException- when the file cannot be accessed (such as when it doesn't exist)
-
generateWorkload
-
setMips
Sets the MIPS capacity of the PEs from the VM where each created Cloudlet is supposed to run. Considering the workload reader provides the run time for each application registered inside the reader, the MIPS value will be used to compute thelength of the Cloudlet (in MI)so that it's expected to execute, inside the VM with the given MIPS capacity, for the same time as specified into the workload reader.- Parameters:
mips- the MIPS value to set
-