mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
Added ResourcePool information:
This commit is contained in:
parent
9ce89212b8
commit
c60748773f
@ -606,7 +606,7 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
||||
for _, pool := range respool {
|
||||
respoolFields := map[string]interface{}{
|
||||
"cpu_limit": pool.Config.CpuAllocation.GetResourceAllocationInfo().Limit,
|
||||
"memory_limit": pool.Config.MemoryAllocation.GetResourceAllocationInfo().Limit,
|
||||
"memory_limit": MBToKB(pool.Config.MemoryAllocation.GetResourceAllocationInfo().Limit),
|
||||
}
|
||||
respoolTags := map[string]string{"pool_name": pool.Name}
|
||||
pt3, err := influxclient.NewPoint("resourcepool", respoolTags, respoolFields, time.Now())
|
||||
@ -627,6 +627,13 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
||||
|
||||
}
|
||||
|
||||
func MBToKB(n int64) int64 {
|
||||
if n != -1 {
|
||||
n = 1000 * n
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func min(n ...int64) int64 {
|
||||
var min int64 = -1
|
||||
for _, i := range n {
|
||||
|
Loading…
x
Reference in New Issue
Block a user