Skip to content

Commit

Permalink
Merge pull request #81 from krische/master
Browse files Browse the repository at this point in the history
Compute usage percentage of datastore.
  • Loading branch information
sofixa committed Aug 9, 2018
2 parents 3f8a36f + a321789 commit 57703fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vsphere-influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 57703fa

Please sign in to comment.