Skip to content

Conversation

@fearful-symmetry
Copy link
Contributor

@fearful-symmetry fearful-symmetry commented Jun 29, 2021

Cherry-pick of PR #26334 to 7.x branch. Original message:

Note that this won't work properly before #26251 is merged and I've re-tested everything with that. However we might also need some additional changes, discussed here: elastic/go-structform#32 (review)

What does this PR do?

This is a continuation of the ongoing refactor of the system module, this time for system/memory. This is considerably simpler than the changes in system/cpu, as the data requires less transformation.

This is also a first pass at an attempt to move towards more "reporting-defined structures" within the system module, as the main Memory struct maps to the final data definition passed upstream. This requires us to do less manual mapping of data, and turns over most of the complexity to the conversion functions. This is designed to work with the OptX types introduced in the system/cpu refactor, as the above PR to go-structform will properly see and omit the nil types.

-->

Why is it important?

This is part of an ongoing refactor of the system code, with a few goals

  • centralize metrics-gathering code in one place
  • Make OS-specific logic more manageable
  • Prevent us from reporting "null zero" metrics
  • (eventually) deprecate gosigar

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  • Pull down PR and build on any supported platform
  • Test the system/memory metricset, make sure all fields are reporting properly, and all the data looks reasonable.

* init commit

* start on linux implementation

* finish linux, start work on darwin

* fix build platform issues

* fix metrics on darwin

* add openbsd

* add freebsd

* add windows, aix

* fix aix build

* finish memory

* fix up opt changes

* cleanup metricset code

* fix up folder methods

* fix calculations, Opt API, gomod

* make notice

* go mod tidy, mage fmt

* fix up linux/memory

* update fields

* update system tests

* fix system tests, again

* fix extra print statements

* fix if block in fillPercentages

* vix Value API

* fix up tests, opt

(cherry picked from commit e008024)
@elasticmachine
Copy link
Contributor

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 29, 2021
@fearful-symmetry fearful-symmetry self-assigned this Jun 29, 2021
@fearful-symmetry fearful-symmetry removed the Team:Integrations Label for the Integrations team label Jun 29, 2021
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 29, 2021
@botelastic
Copy link

botelastic bot commented Jun 29, 2021

This pull request doesn't have a Team:<team> label.

@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 29, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: fearful-symmetry commented: /test

  • Start Time: 2021-06-30T02:02:42.990+0000

  • Duration: 171 min 57 sec

  • Commit: db481af

Test stats 🧪

Test Results
Failed 0
Passed 31517
Skipped 3935
Total 35452

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 31517
Skipped 3935
Total 35452

@fearful-symmetry
Copy link
Contributor Author

/test

@fearful-symmetry fearful-symmetry merged commit 31f7689 into elastic:7.x Jun 30, 2021
@zube zube bot removed the [zube]: Done label Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants