Skip to content

Commit

Permalink
print version if -debug is present
Browse files Browse the repository at this point in the history
  • Loading branch information
sofixa committed Feb 3, 2018
1 parent b2da326 commit a2b0278
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vsphere-influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ func (vcenter *VCenter) Init(config Configuration) error {

client := vcenter.client

// Print version
if debug {
aboutInfo := client.Client.ServiceContent.About
stdlog.Println("Version:", aboutInfo.FullName)
}


var perfmanager mo.PerformanceManager
err := client.RetrieveOne(ctx, *client.ServiceContent.PerfManager, nil, &perfmanager)
if err != nil {
Expand Down Expand Up @@ -753,7 +760,6 @@ func min(n ...int64) int64 {
}
return min
}

func max(n ...int64) int64 {
var max int64 = -1
for _, i := range n {
Expand Down Expand Up @@ -804,7 +810,6 @@ func worker(id int, config Configuration, influxDBClient influxclient.Client, no
results <- true
continue
}

if err := vcenter.Init(config); err == nil {
vcenter.Query(config, influxDBClient, nowTime)
}
Expand Down

0 comments on commit a2b0278

Please sign in to comment.