Class TaskEvent

java.lang.Object
org.cloudsimplus.traces.google.TaskEvent

public final class TaskEvent extends Object
A data class to store the attributes to create a Cloudlet, according to the data read from a line inside a "task events" trace file. Instance of this class are created by the GoogleTaskEventsTraceReader and provided to the user's simulation.

In order to create such Cloudlets, the GoogleTaskEventsTraceReader requires the developer to provide a Function that creates Cloudlets according to the developer needs.

The GoogleTaskEventsTraceReader cannot create the Cloudlets itself by hard-coding some simulation specific parameters such as the UtilizationModel or cloudlet length. This way, it request a Function implemented by the developer using the GoogleTaskEventsTraceReader class that has the custom logic to create Cloudlets. However, this developer's Function needs to receive the task parameters read from the trace file such as CPU, RAM and disk requirements and priority. To avoid passing so many parameters to the developer's Function, an instance of this class that wraps all these parameters is used instead.

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

    • TaskEvent

      public TaskEvent()
  • Method Details

    • getPriority

      public int getPriority()
    • getResourceRequestForCpuCores

      public double getResourceRequestForCpuCores()
      Gets the maximum number of CPU cores the task is permitted to use (in percentage from 0 to 1). This percentage value can be used to compute the number of Pes the Cloudlet will require, based on the number of PEs of the Vm where the Cloudlet will be executed.

      The actual value to be assigned to a Cloudlet created from this trace field must be defined by the researcher, inside the cloudlet creation function given to the trace reader.

      Since there are "task usage" trace files, they can used used to define the CPU utilization along the time. The value of this attribute is not the same as the max resource usage of the CPU UtilizationModel. It just represents the maximum number of CPUs the Cloudlet will use. The percentage that such CPUs will be used for a given time is defined by the CPU UtilizationModel.getUtilization(). Such a value is defined by a "task usage" trace.

      Returns:
      See Also:
    • actualCpuCores

      public long actualCpuCores(long maxCpuCores)
      Computes the actual number of CPU cores (PEs) to be assigned to a Cloudlet, according to the percentage of CPUs to be used and a given maximum number of existing CPUs.
      Parameters:
      maxCpuCores - the maximum number of existing CPUs the Cloudlet can use (that can be defined as the number of VM's CPUs)
      Returns:
      the actual number of CPU cores the Cloudlet will require
    • getResourceRequestForRam

      public double getResourceRequestForRam()
      Gets the maximum amount of RAM the task is permitted to use (in percentage from 0 to 1).

      The actual value to be assigned to a Cloudlet created from this trace field must be defined by the researcher, inside the cloudlet creation function given to the trace reader.

      This field can be used to define the max resource utilization percentage for a UtilizationModel when creating the Cloudlet. Since there are "task usage" trace files, they can be used to define the RAM utilization along the time. In this case, a UtilizationModelDynamic is required for the Cloudlet's RAM UtilizationModel. Using a different class will raise a runtime exception when trying to create the Cloudlets.

      Returns:
      See Also:
    • getResourceRequestForLocalDiskSpace

      public double getResourceRequestForLocalDiskSpace()
      Gets the maximum amount of local disk space the task is permitted to use (in percentage from 0 to 1).

      The actual value to be assigned to a Cloudlet created from this trace field must be defined by the researcher, inside the cloudlet creation function given to the trace reader.

      This field can be used to define the initial Cloudlet file size and/or output size when creating the Cloudlet, according to the researcher needs.

      Returns:
      See Also:
    • getUserName

      public String getUserName()
      Gets the hashed username provided as an opaque base64-encoded string that can be tested for equality.
      Returns:
      See Also:
    • getTimestamp

      public double getTimestamp()
      Gets the time the event happened (converted to seconds).
      Returns:
      See Also:
    • getSchedulingClass

      public int getSchedulingClass()
      Gets the scheduling class that roughly represents how latency-sensitive the task is. The scheduling class is represented by a single number, with 3 representing a more latency-sensitive task (e.g., serving revenue-generating user requests) and 0 representing a non-production task (e.g., development, non-business-critical analyses, etc.).
      Returns:
      See Also:
    • getType

      public TaskEventType getType()
      Gets the event type.
      Returns:
    • of

      public static TaskEvent of(GoogleTaskEventsTraceReader reader)
      Creates a TaskEvent from the current processed line from a Google Task Events trace file.
      Parameters:
      reader -
      Returns:
    • getJobId

      public long getJobId()
      Gets the id of the job this task belongs to.
      Returns:
    • getTaskIndex

      public long getTaskIndex()
      Gets the task index within the job.
      Returns:
    • getUniqueTaskId

      public long getUniqueTaskId()
      An unique ID to be used to identify Cloudlets. The ID is composed of the Job ID, concatenated with the Task Index.
      Returns:
    • getMachineId

      public long getMachineId()
      Gets the machineID that indicates the machine onto which the task was scheduled. If the field is empty, -1 is returned instead.
      Returns: