TaskEvent

public final class TaskEvent extends TaskData

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 hardcoding 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.

Author:Manoel Campos da Silva Filho

Methods

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

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 Cloudet 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.

See also: GoogleTaskEventsTraceReader.FieldIndex.RESOURCE_REQUEST_FOR_CPU_CORES, GoogleTaskUsageTraceReader

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.

See also: GoogleTaskEventsTraceReader.FieldIndex.RESOURCE_REQUEST_FOR_LOCAL_DISK_SPACE

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 used 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 an runtime exception when trying to create the Cloudlets.

See also: GoogleTaskEventsTraceReader.FieldIndex.RESOURCE_REQUEST_FOR_RAM, GoogleTaskUsageTraceReader

getSchedulingClass

public int getSchedulingClass()

Gets the s​cheduling 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.).

See also: GoogleTaskEventsTraceReader.FieldIndex.SCHEDULING_CLASS

getTimestamp

public double getTimestamp()

Gets the time the event happened (converted to seconds).

See also: GoogleTaskEventsTraceReader.FieldIndex.TIMESTAMP

getUserName

public String getUserName()

Gets the hashed username provided as an opaque base64-encoded string that can be tested for equality.

See also: GoogleTaskEventsTraceReader.FieldIndex.USERNAME

setPriority

protected TaskEvent setPriority(int priority)

setResourceRequestForCpuCores

TaskEvent setResourceRequestForCpuCores(double resourceRequestForCpuCores)

setResourceRequestForLocalDiskSpace

TaskEvent setResourceRequestForLocalDiskSpace(double resourceRequestForLocalDiskSpace)

setResourceRequestForRam

TaskEvent setResourceRequestForRam(double resourceRequestForRam)

setSchedulingClass

TaskEvent setSchedulingClass(int schedulingClass)

setTimestamp

protected TaskEvent setTimestamp(double timestamp)

setUserName

TaskEvent setUserName(String userName)