GoogleTaskUsageTraceReader

public final class GoogleTaskUsageTraceReader extends GoogleTraceReaderAbstract<Cloudlet>

Process “task usage” trace files from Google Cluster Data to change the resource utilization of Cloudlets. 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.

Author:Manoel Campos da Silva Filho

See also: .process()

Constructors

GoogleTaskUsageTraceReader

public GoogleTaskUsageTraceReader(List<DatacenterBroker> brokers, String filePath)

Instantiates a GoogleTaskUsageTraceReader to read a “task usage” trace file.

Parameters:
  • brokers – a list of DatacenterBrokers 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 empty
  • UncheckedIOException – when the file cannot be accessed (such as when it doesn’t exist)

See also: .process()

Methods

getInstance

public static GoogleTaskUsageTraceReader getInstance(List<DatacenterBroker> brokers, String filePath)

Gets a GoogleTaskUsageTraceReader instance to read a “task usage” trace file inside the application’s resource directory.

Parameters:
  • brokers – a list of DatacenterBrokers 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 empty
  • UncheckedIOException – when the file cannot be accessed (such as when it doesn’t exist)

See also: .process()

postProcess

protected void postProcess()

preProcess

protected void preProcess()

There is not pre-process for this implementation.

process

public Set<Cloudlet> process()

Process the trace file request to change the resource usage of Cloudlets as described in the file. It returns the List of all processed Cloudlets.

If the Cloudlets created by a GoogleTaskEventsTraceReader use a UtilizationModelFull to define that the CPUs required by the Cloudlets will be used 100%, when 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% won’t make the Cloudlet to finish earlier (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, the 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. If it’s using a lower percentage of the CPU capacity, it will execute less instructions in that 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 the Cloudlets are using.

Returns:the Set of all Cloudlets processed according to a line in the trace file

processParsedLineInternal

protected boolean processParsedLineInternal()