All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ligoj.app.plugin.prov.model.ProvFunctionPrice Maven / Gradle / Ivy

The newest version!
/*
 * Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
 */
package org.ligoj.app.plugin.prov.model;

import jakarta.persistence.Entity;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import jakarta.validation.constraints.Positive;

import lombok.Getter;
import lombok.Setter;

/**
 * A priced function with billing configuration. 
* The cost attribute is the corresponding effective monthly cost of this function independent of the actual usage or * memory: pre-warmed resource. Includes the initial cost to allow quick sort. To compute the remaining monthly cost * reduced by the initial cost, the formula is : cost - initialCost / 24 / 365. Computation sample with * nbRequests=1M, duration=1s, ram=1GiB *
    *
  • AWS: max memory = 10, 240MiB, min memory = 128MiB, incrementRam=1MiB *
      *
    • Standard: 1M * costRequests + 1M * costRamRun * 1024MiB/1024 * 1s/(3600*24*30,5)
    • *
    • Provisioned: cost standard + (costCpu+costRam) * concurrency * ratio 1M * (costRequests + 1024MiB/1024 * * costRam{Provisioned Concurrency + Duration} * 1s/(1000*3600*24*30,5)); type = custom type
    • *
    *
  • *
  • Azure *
      *
    • Consumption: 1M * costRequests + 1024MiB/1024 * costRam * 1s/(3600*24*30,5)); max memory = 1.5GiB, min memory = * 128MiB, incrementRam= 128MiB
    • *
    • Premium: 1M * (costRequests + 1024/1024 * costRam{Provisioned Concurrency + Duration} * * 1s/(1000*3600*24*30,5))
    • *
    *
  • *
*/ @Getter @Setter @Entity @Table(name = "LIGOJ_PROV_FUNCTION_PRICE", uniqueConstraints = { @UniqueConstraint(columnNames = "code") }, indexes = { @Index(name = "lookup_f_index", columnList = "location,type,term,license") }) public class ProvFunctionPrice extends AbstractTermPriceVm { /** * SID */ private static final long serialVersionUID = 1L; /** * Cost per millions requests. */ private double costRequests; /** * Cost per GiB of RAM actually consumed during one month whatever the concurrency. */ private double costRamRequest; /** * Cost per GiB of RAM actually consumed during one month within the concurrency limit. */ private double costRamRequestConcurrency; /** * Increment of the billed duration of a single request. */ @Positive private double incrementDuration; /** * Minimal billed duration of a single request. In milliseconds. */ private double minDuration; /** * Maximal duration of a single request. In milliseconds. */ private Double maxDuration; /** * CO2 per millions requests. */ private double co2Requests; /** * CO2 per GiB of RAM actually consumed during one month whatever the concurrency. */ private double co2RamRequest; /** * CO2 per GiB of RAM actually consumed during one month within the concurrency limit. */ private double co2RamRequestConcurrency; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy