(Click to open topic with navigation)
Charge rates establish how much to charge for usage. A charge rate consists of its name, an optional value, and the amount. Charge rates are applied when usage properties matching the charge rate names are found in the usage data. In order for a charge rate of a given name to be applied, a usage record attribute of the same name must exist. For example, a charge rate having the name Processors will be applied if Processors is defined as a Usage Record attribute and the incoming usage data for the charge request contains a property called Processors that matches the value specified in the charge rate.
There are two basic types of charge rates: Name-valued charge rates and Numeric-valued charge rates.
A charge rate amount may have an operation modifier which dictates the way the rate is factored into the charge calculation. For example, consumption-based charge rates or usage fees will often be additive in nature while quality-based charge rates may be multiplicative. The additive charge rates may be further distinguished by whether they should be added before or after the multiplicative charge rates are applied. The charge formula can be represented in the following form: (S(Pre-Additive Rates)*P(Multiplicative Rates))+S(Post-Additive Rates). Thus, there are three operation modifiers: Pre-Additive, Multiplicative and Post-Additive.
| Composite type | Description |
|---|---|
| Pre-Additive | Pre-additive modifiers are applied to charge rates that should be added together before any charge multipliers are applied. A pre-additive modifier is specified by prepending a plus sign '+' to the charge rate amount. Since pre-additive is the most commonly specified operation modifier, a charge rate amount without an operation modifier will be assumed to be pre-additive by default. |
| Multiplicative | Multiplicative modifiers are applied to charge rates that should be multiplied together with other multiplicative charge rates and with the sum of the pre-additive charge rates. A multiplicative modifier is specified by prepending an asterisk '*' to the charge rate amount. |
| Post-Additive | Post-additive modifiers are applied to charge rates that should be added together after any charge multipliers are applied. A post-additive modifier is specified by appending a plus sign '+' to the charge rate amount. |
A pre-additive charge rate may have a time-based modifier which dictates that the charge should be multiplied by the amount of time the feature was used. For example, it is common for the processor charge to be multiplied by the the amount of time the processors were used. A time-based modifier is specified by appending a forward slash '/' to the charge rate amount, followed by one of the following time designators: s (per-second), m (per-minute), h (per-hour), d (per-day), W (per-week), M (per-month), Y (per-year). As an example, a per-hour time-based modifier is specified by appending '/h' to the charge rate amount and will cause a charge to be multiplied by the number of hours the feature was used. Technically, a rate with a time-based modifier will be multiplied by the number of seconds the feature was used, then divided by the number of seconds corresponding to the time designator (e.g. 3600), and will ultimately be rounded to the number of decimal places in the currency precision.
A pre-additive charge rate may have a divisor modifier which dictates that the charge should be divided by the specified integer. A divisor modifier is specified by appending a forward slash '/' to the charge rate amount, followed by an integer number. A divisor modifier can be used in lieu of expressing a small decimal fraction charge rate such as when converting a value from MegaBytes to GigaBytes. If a divisor modifier is used in conjunction with a time-based modifier, the divisor modifier must precede the time-based modifier.
A charge rate may have one or more conditions which dictates additional qualifications that must be met in order for the charge rate to be applied. A condition is specified by prepending <propertyName>=<propertyValue> followed by a question mark '?' to the value field of the charge rate. If you want Processors to apply a special charge rate (e.g. .5/s) for user amy, the charge rate value should consist of the string "User=amy?". Additionally, you may combine charge rate conditions with either a pipe symbol '|' for or, or an ampersand symbol '&' for and. For example, User=amy|User=dave? or User=amy&Project=chemistry?. You may not combine ands and ors in the same charge rate value.