mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
Merge pull request #81 from krische/master
Compute usage percentage of datastore.
This commit is contained in:
commit
57703fa0b3
@ -719,6 +719,7 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
||||
datastoreFields := map[string]interface{}{
|
||||
"capacity": datastore.Summary.Capacity,
|
||||
"free_space": datastore.Summary.FreeSpace,
|
||||
"usage": 1.0 - (float64(datastore.Summary.FreeSpace)/float64(datastore.Summary.Capacity)),
|
||||
}
|
||||
datastoreTags := map[string]string{"ds_name": datastore.Summary.Name, "host": vcName}
|
||||
pt4, err := influxclient.NewPoint(config.InfluxDB.Prefix+"datastore", datastoreTags, datastoreFields, time.Now())
|
||||
|
Loading…
Reference in New Issue
Block a user