Class GoogleTaskUsageTraceReader

All Implemented Interfaces:
TraceReader

public final class GoogleTaskUsageTraceReader extends TraceReaderBase
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.

Check important details at TraceReaderAbstract.

Since:
CloudSim Plus 4.0.0
Author:
Manoel Campos da Silva Filho
See Also:
  • Constructor Details

  • Method Details

    • 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

      public Collection<Cloudlet> process()
      Process trace file requests to change resource usage of Cloudlets as described in the file. It returns the List of all processed Cloudlets.

      When using a GoogleTaskEventsTraceReader and you create Cloudlets with an UtilizationModelFull 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 Cloudlets 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

      protected Collection<Cloudlet> getAvailableObjects()
    • findObject

      protected final Optional<Cloudlet> findObject(long id)