Skip to content

Commit

Permalink
Fix bad calculwation of dediacted vm
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentBaer authored and Vincent Baer committed Feb 12, 2024
1 parent a33f9f5 commit 9c9d35a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "osc-cost"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
authors = ["OpenSource Team <[email protected]>"]
license = "BSD-3-Clause"
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Read license for more details.
- Volumes
- Public Ips
- Snapshots (🚨 Warning: snapshot computation is currently known to be over-priced.)
- Dedicated Vm (🚨 Warning: dedicated vm computation can be overpriced depending on the situation (Look at example of Pricing for Dedicated VMs [Getting the Price of Your Resources](https://docs.outscale.com/en/userguide/Getting-the-Price-of-Your-Resources.html#_calculating_the_price_of_dedicated_vms)) .)
- Dedicated Vm
- Load Balancers
- Flexible GPU
- VPN Connections
Expand Down
2 changes: 1 addition & 1 deletion helm/osccost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.4.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.5.0"
appVersion: "0.5.1"
2 changes: 1 addition & 1 deletion helm/osccost/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# osccost

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.0](https://img.shields.io/badge/AppVersion-0.5.0-informational?style=flat-square)
![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.1](https://img.shields.io/badge/AppVersion-0.5.1-informational?style=flat-square)

Exporter prometheus to allow Outscale users to estimate their cloud costs.

Expand Down
3 changes: 2 additions & 1 deletion src/oapi/vms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,11 @@ impl VmSpecs {
}

fn parse_dedicated_instance_additional_prices(mut self, input: &Input) -> Option<VmSpecs> {
// dedicated_vm_additional is expressed as a percent
let dedicated_vm_additional =
input.catalog_entry("TinaOS-FCU", "DedicatedInstanceSurplus", "RunInstances")?;
self.factor_vm_additional_cost = match self.tenancy.as_str() {
"dedicated" => 1.0 + ((dedicated_vm_additional * 10000.0) / 100.0),
"dedicated" => 1.0 + (dedicated_vm_additional * 100.0),
"default" => 1.0,
unkown_tenancy => {
error!(
Expand Down

0 comments on commit 9c9d35a

Please sign in to comment.