Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CostCalculator ¶
type CostCalculator interface { // CalculateCost calculates the Rate at which a group of resources should be charged for. CalculateCost(resources []Resource) (Rate, error) }
CostCalculator holds a method to calculate the cost of a group of resources.
type Rate ¶
type Rate struct { // Amount is the money a resource costs in the minimum Currency value (e.g. cents for USD) at a certain Frequency. Amount uint // Currency is the ISO 4217 currency code in lowercase format. Currency string // Frequency is the frequency at which a resource gets charged. // As an example, setting this to time.Hour indicates a rate of `Amount` credits per hour. Frequency time.Duration }
Rate is the rate at what a certain resource is charged.
func AggregateRates ¶
AggregateRates aggregates the given rates and returns the representation in hours.
type Resource ¶
type Resource struct { // Values contains a set of arbitrary values used to calculate the Rate of this resource. Values map[string]interface{} }
Resource groups a set of fields from a resource consumed by cloudsim. It's used to calculate the cost at which the resource should be charged for.
Click to show internal directories.
Click to hide internal directories.