mirror of
https://github.com/jangraefen/hcloud-pricing-exporter
synced 2024-11-10 05:54:15 +00:00
Fix wrong version conversions
This commit is contained in:
parent
e685d60aba
commit
0781f18940
3 changed files with 2 additions and 6 deletions
|
@ -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)
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
sizeGB = 1 << (10 * 3)
|
||||
sizeTB = 1 << (10 * 4)
|
||||
)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue