Class GoogleTaskUsageTraceReader
- All Implemented Interfaces:
TraceReader
Cloudlet
s.
The trace files are the ones inside the task_usage sub-directory of downloaded Google traces.
The instructions to download the traces are provided in the link above.
A spreadsheet that makes it easier to understand the structure of trace files is provided in docs/google-cluster-data-samples.xlsx
The documentation for fields and values were obtained from the Google Cluster trace documentation in the link above. It's strongly recommended to read such a documentation before trying to use this class.
Check important details at TraceReaderAbstract
.
- Since:
- CloudSim Plus 4.0.0
- Author:
- Manoel Campos da Silva Filho
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The index of each field in the trace file. -
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.util.TraceReader
LOGGER
-
Constructor Summary
ConstructorDescriptionGoogleTaskUsageTraceReader
(List<DatacenterBroker> brokers, String filePath) Instantiates aGoogleTaskUsageTraceReader
to read a "task usage" trace file. -
Method Summary
Modifier and TypeMethodDescriptionprotected final int
Gets the number of objects available (created) so far.findObject
(long id) protected Collection<Cloudlet>
static GoogleTaskUsageTraceReader
getInstance
(List<DatacenterBroker> brokers, String filePath) Gets aGoogleTaskUsageTraceReader
instance to read a "task usage" trace file inside the application's resource directory.protected void
Executes any post-process after the trace file was totally parsed.protected void
There is not pre-process for this implementation.process()
Processtrace file
requests to change resource usage ofCloudlet
s as described in the file.protected boolean
Process the last parsed trace line.Methods inherited from class org.cloudsimplus.traces.TraceReaderBase
getFieldDoubleValue, getFieldDoubleValue, getFieldIntValue, getFieldIntValue, getFieldLongValue, getFieldLongValue, getFieldValue, getLastParsedLineArray, setLastParsedLineArray
Methods inherited from class org.cloudbus.cloudsim.util.TraceReaderAbstract
getCommentString, getFieldDelimiterRegex, getFilePath, getInputStream, getLastLineNumber, getMaxLinesToRead, parseTraceLine, readFile, readGZIPFile, readTextFile, readZipFile, setCommentString, setFieldDelimiterRegex, setMaxLinesToRead
-
Constructor Details
-
GoogleTaskUsageTraceReader
public GoogleTaskUsageTraceReader(List<DatacenterBroker> brokers, String filePath) throws IOException Instantiates aGoogleTaskUsageTraceReader
to read a "task usage" trace file.- Parameters:
brokers
- a list ofDatacenterBroker
s that own running Cloudlets for which resource usage will be read from the trace.filePath
- the workload trace relative file name in one of the following formats: ASCII text, zip, gz.- Throws:
IllegalArgumentException
- when the trace file name is null or emptyUncheckedIOException
- when the file cannot be accessed (such as when it doesn't exist)IOException
- See Also:
-
-
Method Details
-
getInstance
public static GoogleTaskUsageTraceReader getInstance(List<DatacenterBroker> brokers, String filePath) Gets aGoogleTaskUsageTraceReader
instance to read a "task usage" trace file inside the application's resource directory.- Parameters:
brokers
- a list ofDatacenterBroker
s that own running Cloudlets for which resource usage will be read from the trace.filePath
- the workload trace relative file name in one of the following formats: ASCII text, zip, gz.- Throws:
IllegalArgumentException
- when the trace file name is null or emptyUncheckedIOException
- when the file cannot be accessed (such as when it doesn't exist)- See Also:
-
process
Processtrace file
requests to change resource usage ofCloudlet
s as described in the file. It returns the List of all processedCloudlet
s.When using a
GoogleTaskEventsTraceReader
and you create Cloudlets with anUtilizationModelFull
to define that required CPUs will be used in 100% of their capacity, if the "task usage" file is read, a different CPU usage can be set. In regular simulations, if this value is smaller, a Cloudlet will spend more time to finish. However, since the "task events" file defines the exact time to finish each Cloudlet, using less than 100% of the CPU capacity won't make the Cloudlet to finish later (as in simulations not using the Google Cluster Data). Each Cloudlet will just have a smaller length at the end of the simulation.These trace files don't define the length of the Cloudlet (task). This way, Cloudlets are created with an indefinite length (see
Cloudlet.setLength(long)
) and the length is increased as the Cloudlet is executed. Therefore, if the Cloudlet is using a higher percentage of the CPU capacity, it will execute more instructions in a given time interval.In conclusion, the exec and finish time of Cloudlets created from Google Cluster trace files won't change according to the percentage of CPU capacity the Cloudlets are using.
- Returns:
- the Set of all
Cloudlet
s processed according to a line in the trace file
-
preProcess
protected void preProcess()There is not pre-process for this implementation. -
postProcess
protected void postProcess()Executes any post-process after the trace file was totally parsed. TODO Such a method should be defined as a Functional attribute. Since it won't be implemented by every subclass, by it being abstract, forces to subclasses to implement it (even if just including an empty method). -
processParsedLineInternal
protected boolean processParsedLineInternal()Process the last parsed trace line.- Returns:
- true if the parsed line was processed, false otherwise
- See Also:
-
availableObjectsCount
protected final int availableObjectsCount()Gets the number of objects available (created) so far.- Returns:
-
getAvailableObjects
-
findObject
-