diff --git a/client.go b/client.go index 01f77d0..66a767b 100644 --- a/client.go +++ b/client.go @@ -198,9 +198,9 @@ type Container struct { } type ObjectStorageUsage struct { - containers []Container - quota float64 - total_usage float64 + containers []Container + quota float64 + totalUsage float64 } // オブジェクトストレージの使用容量を取得 @@ -222,15 +222,15 @@ func (cc *ConohaClient) ObjectStorageUsage() (*ObjectStorageUsage, error) { return nil, err } - total_usage, err := strconv.ParseFloat(headers.Get("X-Account-Bytes-Used"), 64) + totalUsage, err := strconv.ParseFloat(headers.Get("X-Account-Bytes-Used"), 64) if err != nil { return nil, err } return &ObjectStorageUsage{ - containers: uResp, - quota: quota, - total_usage: total_usage, + containers: uResp, + quota: quota, + totalUsage: totalUsage, }, nil } diff --git a/exporter.go b/exporter.go index f339e2d..8e94912 100644 --- a/exporter.go +++ b/exporter.go @@ -63,7 +63,7 @@ func (cc *ConohaCollector) AutoUpdate() { log.Fatal(err) } metrics = append(metrics, prometheus.MustNewConstMetric(cc.describes[1], prometheus.GaugeValue, usage.quota)) - metrics = append(metrics, prometheus.MustNewConstMetric(cc.describes[2], prometheus.GaugeValue, usage.total_usage)) + metrics = append(metrics, prometheus.MustNewConstMetric(cc.describes[2], prometheus.GaugeValue, usage.totalUsage)) for _, container := range usage.containers { metrics = append(metrics, prometheus.MustNewConstMetric(cc.describes[3], prometheus.GaugeValue, float64(container.Bytes), container.Name))