-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[metricbeat] migrate vsphere/host to ReporterV2 #11403
[metricbeat] migrate vsphere/host to ReporterV2 #11403
Conversation
|
||
events, err := f.Fetch() | ||
f := mbtest.NewReportingMetricSetV2Error(t, getConfig(ts)) | ||
events, errs := mbtest.ReportingFetchV2Error(f) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be removed as it checks an error from above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
@@ -24,8 +24,8 @@ import ( | |||
) | |||
|
|||
func eventMapping(hs mo.HostSystem) common.MapStr { | |||
totalCpu := int64(hs.Summary.Hardware.CpuMhz) * int64(hs.Summary.Hardware.NumCpuCores) | |||
freeCpu := int64(totalCpu) - int64(hs.Summary.QuickStats.OverallCpuUsage) | |||
totalCPU := int64(hs.Summary.Hardware.CpuMhz) * int64(hs.Summary.Hardware.NumCpuCores) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the naming cleanup
see #10774
Discovered something somewhat troubling here, which is that the
eventMapping
function indata.go
isn't used anywhere inFetch()
. It has a test, but that's it.