Fix wrong version conversions

This commit is contained in:
Jan Gräfen 2021-03-07 00:40:07 +01:00
parent e685d60aba
commit 0781f18940
3 changed files with 2 additions and 6 deletions

View file

@ -1,8 +1,6 @@
package fetcher
import (
"math"
"github.com/hetznercloud/hcloud-go/hcloud"
)
@ -25,7 +23,7 @@ func (snapshot snapshot) Run(client *hcloud.Client) error {
for _, i := range images {
if i.Type == "snapshot" {
monthlyPrice := math.Ceil(float64(i.ImageSize)/sizeGB) * snapshot.pricing.Image()
monthlyPrice := float64(i.ImageSize) * snapshot.pricing.Image()
hourlyPrice := pricingPerHour(monthlyPrice)
snapshot.hourly.WithLabelValues(i.Name).Set(hourlyPrice)

View file

@ -8,7 +8,6 @@ import (
)
const (
sizeGB = 1 << (10 * 3)
sizeTB = 1 << (10 * 4)
)

View file

@ -1,7 +1,6 @@
package fetcher
import (
"math"
"strconv"
"github.com/hetznercloud/hcloud-go/hcloud"
@ -25,7 +24,7 @@ func (volume volume) Run(client *hcloud.Client) error {
}
for _, v := range volumes {
monthlyPrice := math.Ceil(float64(v.Size)/sizeGB) * volume.pricing.Volume()
monthlyPrice := float64(v.Size) * volume.pricing.Volume()
hourlyPrice := pricingPerHour(monthlyPrice)
volume.hourly.WithLabelValues(v.Name, v.Location.Name, strconv.Itoa(v.Size)).Set(hourlyPrice)