Class SlaContract

java.lang.Object
org.cloudsimplus.slametrics.SlaContract

public class SlaContract extends Object
Represents an SLA Contract containing a list of metrics. It follows the standard used by Amazon Cloudwatch.

The constants inside the class define the names of SLA Metrics supported in the JSON SLA Contract format.

Instances of this class can be created from a JSON file using the getInstanceInternal(InputStream) or getInstance(String) methods. This way, one doesn't need to create instances of this class using its default constructor. This one is just used by the JSON parsing library.

For more details, check Raysa Oliveira's Master Thesis (only in Portuguese).

Author:
raysaoliveira
  • Constructor Details

    • SlaContract

      public SlaContract()
      Creates a SlaContract. If you want to get a contract from a JSON file, you shouldn't call the constructor directly. Instead, use some methods of the class methods.

      This constructor is just provided to enable the Gson object to use reflection to instantiate a SlaContract.

      See Also:
  • Method Details

    • getInstance

      public static SlaContract getInstance(String jsonFilePath)
      Gets an SlaContract from a JSON file inside the application's resource directory.
      Parameters:
      jsonFilePath - the relative path to the JSON file representing the SLA contract to read
      Returns:
      a SlaContract read from the JSON file
    • getMetrics

      public List<SlaMetric> getMetrics()
      Returns:
      the metrics list
    • setMetrics

      public void setMetrics(List<SlaMetric> metrics)
      Parameters:
      metrics - the metrics to set
    • getAvailabilityMetric

      public SlaMetric getAvailabilityMetric()
    • getCpuUtilizationMetric

      public SlaMetric getCpuUtilizationMetric()
    • getPriceMetric

      public SlaMetric getPriceMetric()
    • getWaitTimeMetric

      public SlaMetric getWaitTimeMetric()
    • getTaskCompletionTimeMetric

      public SlaMetric getTaskCompletionTimeMetric()
    • getFaultToleranceLevel

      public SlaMetric getFaultToleranceLevel()
    • getMaxPrice

      public double getMaxPrice()
      Gets the maximum price a customer expects to pay hourly for all his/her running VMs.
      Returns:
    • getExpectedMaxPriceForSingleVm

      public double getExpectedMaxPriceForSingleVm()
      Gets the expected maximum price a single VM can cost, considering the Fault Tolerance Level.
      Returns:
      the expected maximum price a single VM can cost for the given customer AwsEc2Template for the customer's expected price
    • getMinFaultToleranceLevel

      public int getMinFaultToleranceLevel()
    • toString

      public String toString()
      Overrides:
      toString in class Object