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

[metricbeat] migrate vsphere/host to ReporterV2 #11403

Conversation

fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Mar 22, 2019

see #10774

Discovered something somewhat troubling here, which is that the eventMapping function in data.go isn't used anywhere in Fetch(). It has a test, but that's it.

@fearful-symmetry fearful-symmetry added Metricbeat Metricbeat Team:Integrations Label for the Integrations team technical_debt labels Mar 22, 2019
@fearful-symmetry fearful-symmetry requested a review from a team March 22, 2019 20:36

events, err := f.Fetch()
f := mbtest.NewReportingMetricSetV2Error(t, getConfig(ts))
events, errs := mbtest.ReportingFetchV2Error(f)
if err != nil {
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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

@fearful-symmetry fearful-symmetry requested review from ruflin and a team March 25, 2019 14:53
@fearful-symmetry fearful-symmetry merged commit 289fc23 into elastic:master Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Metricbeat Metricbeat Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants