Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

average metrics all equal 1 #17

Closed
jkcouch opened this issue May 16, 2017 · 5 comments
Closed

average metrics all equal 1 #17

jkcouch opened this issue May 16, 2017 · 5 comments

Comments

@jkcouch
Copy link

jkcouch commented May 16, 2017

When I look in influxdb, all the metrics that are "average" equal 1. I checked a different vsphere api call, and saw that they have correct values.

The debug flag doesnt show the metrics being sent to influx, so i am not sure where its getting mistranslated. Here is an example of the influx query.

influx -format=json -pretty

SELECT * FROM "hostsystem" WHERE "name" = 'host123' LIMIT 1

"results": [
{
"series": [
{
"name": "hostsystem",
"columns": [
"time",
"cpu_corecount_total",
"cpu_ready_summation",
"cpu_usage_average",
"cpu_usage_maximum",
"cpu_usagemhz_average",
"cpu_usagemhz_maximum",
"cpu_wait_summation",
"datastore_numberreadaveraged_average",
"datastore_numberwriteaveraged_average",
"datastore_read_average",
"datastore_totalreadlatency_average",
"datastore_totalwritelatency_average",
"datastore_write_average",
"disk_maxtotallatency_latest",
"host",
"mem_active_average",
"mem_active_maximum",
"mem_consumed_average",
"mem_consumed_maximum",
"mem_totalcapacity_average",
"mem_usage_average",
"mem_usage_maximum",
"mem_vmmemctl_average",
"mem_vmmemctl_maximum",
"name",
"net_packetsrx_summation",
"net_packetstx_summation",
"net_received_average",
"net_transmitted_average"
],
"values": [
[
1494945902000000000,
56,
49,
1,
5869,
1,
42683,
838671,
1,
1,
1,
1,
1,
1,
0,
"vcenter",
1,
224094636,
1,
240620352,
1,
1,
4482,
1,
0,
"host123",
401873,
4684,
1,
1
],

@jkcouch
Copy link
Author

jkcouch commented May 17, 2017

#5 could be related?

@sofixa
Copy link
Member

sofixa commented May 24, 2017

Hi, @jkcouch , #21 by @adongy should fix this, could you give it a try?

@jkcouch
Copy link
Author

jkcouch commented May 24, 2017

Thanks! I am getting an error on compile. I have tried from a few different boxes that were working before. Am I missing something?

$ go get -v github.com/oxalide/vsphere-influxdb-go
github.com/oxalide/vsphere-influxdb-go (download)
github.com/davecgh/go-spew (download)
github.com/influxdata/influxdb (download)
github.com/vmware/govmomi (download)
Fetching https://golang.org/x/net/context?go-get=1
Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
get "golang.org/x/net/context": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
Fetching https://golang.org/x/net?go-get=1
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
golang.org/x/net (download)
github.com/davecgh/go-spew/spew
github.com/influxdata/influxdb/pkg/escape
github.com/influxdata/influxdb/models
github.com/vmware/govmomi/vim25/debug
github.com/vmware/govmomi/vim25/progress
github.com/vmware/govmomi/vim25/types
github.com/influxdata/influxdb/client/v2
github.com/vmware/govmomi/vim25/xml
golang.org/x/net/context
github.com/vmware/govmomi/vim25/soap
github.com/vmware/govmomi/vim25/methods
github.com/vmware/govmomi/vim25
github.com/vmware/govmomi/vim25/mo
github.com/vmware/govmomi/property
github.com/vmware/govmomi/session
github.com/vmware/govmomi
github.com/oxalide/vsphere-influxdb-go
`# github.com/oxalide/vsphere-influxdb-go
gocode/src/github.com/oxalide/vsphere-influxdb-go/vsphere-influxdb.go:400: undefined: vmsummary
gocode/src/github.com/oxalide/vsphere-influxdb-go/vsphere-influxdb.go:402: undefined: vmsummary
gocode/src/github.com/oxalide/vsphere-influxdb-go/vsphere-influxdb.go:402: undefined: host_summary

@adongy
Copy link
Contributor

adongy commented May 24, 2017

Seems like i forgot to push my branch before doing the pull request, #22 should fix it.

@jkcouch
Copy link
Author

jkcouch commented May 24, 2017

With both fixes its working as expected! Thank you.

I confirmed by pulling #22 then manually updated the "total += i" that was fixed in #21 . I will watch for the merge and test after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants