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

Host decorator #85

Merged
merged 4 commits into from
Aug 12, 2020
Merged

Host decorator #85

merged 4 commits into from
Aug 12, 2020

Conversation

camdencheek
Copy link
Contributor

@camdencheek camdencheek commented Aug 10, 2020

Description of Changes

Add a host metadata decorator. Supports adding hostname and ip address to the log entries.

Currently there is no customization for what IP address, but in the future, we may add options for preferred interface, ipv4 vs ipv6, or an option to add external IP.

I was unable to figure out a way to mock calls to net.Interfaces() effectively, so our tests currently don't test the IP functionality at all. Would love to hear ideas, but I'm currently convinced it's not possible. See this for more detail: https://stackoverflow.com/questions/24564840/golang-net-package-mocking

Please check that the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Add a changelog entry (for non-trivial bug fixes / features)
  • CI passes

@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #85 into master will decrease coverage by 0.48%.
The diff coverage is 38.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #85      +/-   ##
==========================================
- Coverage   74.62%   74.14%   -0.48%     
==========================================
  Files          66       67       +1     
  Lines        3991     4045      +54     
==========================================
+ Hits         2978     2999      +21     
- Misses        762      790      +28     
- Partials      251      256       +5     
Impacted Files Coverage Δ
operator/builtin/transformer/host_metadata.go 38.89% <38.89%> (ø)
operator/builtin/input/file/read_to_end.go 62.69% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ec38be...149f66d. Read the comment docs.

@djaglowski
Copy link
Member

Log Files Logs / Second CPU Avg (%) CPU Avg Δ (%) Memory Avg (MB) Memory Avg Δ (MB)
1 1000 2.9483392 -0.4828403 27.368534 -1.1893864
1 5000 7.68986 -0.48279333 39.767647 -0.34819412
1 10000 14.379564 +0.01718998 52.864494 -0.5818939
1 50000 58.086323 +0.0039138794 1372.0466 +1202.7341
1 100000 106.64057 -1.9049911 890.1001 +606.68494
10 100 5.0173283 +0.2586112 30.231142 +2.5378494
10 500 10.759035 +0.7933445 41.40948 +3.890892
10 1000 16.448626 +0.2240963 56.39709 +3.9500275
10 5000 64.60442 +0.7589302 247.6184 +80.63617
10 10000 42.777935 -73.864334 2633.6519 +2316.222

@observIQ observIQ deleted a comment from djaglowski Aug 12, 2020
@camdencheek camdencheek merged commit 478054e into master Aug 12, 2020
@camdencheek camdencheek deleted the host-decorator branch August 20, 2020 13:28
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

Successfully merging this pull request may close these issues.

3 participants