Skip to content

[metricbeat] migrate vsphere/host to ReporterV2#11403

Merged
fearful-symmetry merged 2 commits intoelastic:masterfrom
fearful-symmetry:migration/mb/reporterv2/vsphere/host
Mar 26, 2019
Merged

[metricbeat] migrate vsphere/host to ReporterV2#11403
fearful-symmetry merged 2 commits intoelastic:masterfrom
fearful-symmetry:migration/mb/reporterv2/vsphere/host

Conversation

@fearful-symmetry
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

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
Copy Markdown
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 a team and ruflin 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