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

added newrelic close buffer #577

Merged
merged 4 commits into from
Feb 28, 2022
Merged

added newrelic close buffer #577

merged 4 commits into from
Feb 28, 2022

Conversation

armstrmi
Copy link
Contributor

Description of Changes

  • Added close buffer functionality newrelic
  • Added tests to test buffer functionality

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

@armstrmi armstrmi requested a review from a team as a code owner February 25, 2022 20:15
@armstrmi armstrmi requested review from dehaansa and a team and removed request for a team February 25, 2022 20:15
@codecov
Copy link

codecov bot commented Feb 25, 2022

Codecov Report

Merging #577 (1d48d5f) into buffer-rework (78623d8) will increase coverage by 5.30%.
The diff coverage is 85.40%.

Impacted file tree graph

@@                Coverage Diff                @@
##           buffer-rework     #577      +/-   ##
=================================================
+ Coverage          67.50%   72.80%   +5.30%     
=================================================
  Files                 61       75      +14     
  Lines               3886     5585    +1699     
=================================================
+ Hits                2623     4066    +1443     
- Misses              1060     1279     +219     
- Partials             203      240      +37     
Impacted Files Coverage Δ
operator/buffer/buffer.go 75.86% <ø> (-1.92%) ⬇️
...builtin/input/aws/cloudwatch/cloudwatch_persist.go 62.50% <ø> (-8.93%) ⬇️
operator/builtin/input/azure/event_hub.go 0.00% <ø> (ø)
operator/builtin/input/azure/event_hub_config.go 90.91% <ø> (-1.09%) ⬇️
operator/builtin/input/file/finder.go 100.00% <ø> (ø)
operator/builtin/input/file/reader.go 53.05% <0.00%> (-5.73%) ⬇️
operator/builtin/input/http/config.go 97.03% <ø> (-0.23%) ⬇️
operator/builtin/input/journald/journald.go 57.06% <ø> (-2.03%) ⬇️
operator/builtin/output/googlecloud/severity.go 100.00% <ø> (+72.73%) ⬆️
operator/helper/persist/cached_persister.go 100.00% <ø> (ø)
... and 88 more

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 4c1a539...1d48d5f. Read the comment docs.

Copy link
Contributor

@BinaryFissionGames BinaryFissionGames left a comment

Choose a reason for hiding this comment

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

Got a few nitpicks, looks good!

operator/builtin/output/newrelic/client.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/client.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/newrelic.go Show resolved Hide resolved
operator/builtin/output/newrelic/newrelic_test.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/newrelic_test.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/newrelic.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/newrelic.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/newrelic.go Outdated Show resolved Hide resolved
operator/builtin/output/newrelic/client.go Outdated Show resolved Hide resolved
@BinaryFissionGames
Copy link
Contributor

The windows unit test failure is interesting, golang/go#22553 - may or may not be related to this pr, I'd be a little surprised if it was related, though.

@armstrmi armstrmi merged commit 9129334 into buffer-rework Feb 28, 2022
@armstrmi armstrmi deleted the newrelic-buffer-rework branch February 28, 2022 17:44
cpheps pushed a commit that referenced this pull request Feb 28, 2022
* added newrelic close buffer

* made necessary fixes

* made necessary fixes

* unexport client from client.go
cpheps pushed a commit that referenced this pull request Mar 1, 2022
* added newrelic close buffer

* made necessary fixes

* made necessary fixes

* unexport client from client.go
cpheps pushed a commit that referenced this pull request Mar 1, 2022
* Changed the buffer interface and updated affected operators

Moved current buffers to .old files and created stubs of new ones that satisfy the interface

Signed-off-by: Corbin Phelps <[email protected]>

* Refactored buffer interface to remove drain in favor of a close that returns entries (#498)

Signed-off-by: Corbin Phelps <[email protected]>

* Memory buffer rework (#497)

* Implemented reworked memory buffer and started tests

Signed-off-by: Corbin Phelps <[email protected]>

* Working on memory buffer tests

Signed-off-by: Corbin Phelps <[email protected]>

* Fully tested memory buffer

Signed-off-by: Corbin Phelps <[email protected]>

* Removed memory_buffer*.old files

Signed-off-by: Corbin Phelps <[email protected]>

* Removed intentional race condition from memory buffer test so race flag wouldn't tirgger

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed comment in memorybuffer build

Signed-off-by: Corbin Phelps <[email protected]>

* Renamed buffer closed error

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed output operators. Most would fail on error equality to a wrapped error

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed comment for memorybuffer

Signed-off-by: Corbin Phelps <[email protected]>

* Removed operatorID from buffer builder interface (#499)

Signed-off-by: Corbin Phelps <[email protected]>

* Corrected documentation of memory buffer (#502)

* Corrected documentation of memory buffer

Signed-off-by: Corbin Phelps <[email protected]>

* Implemented PR feedback

Signed-off-by: Corbin Phelps <[email protected]>

* Implemented some wording changes

Signed-off-by: Corbin Phelps <[email protected]>

* Refactored flusher logic (#501)

* Refactored flusher to be a bit more readable and to have the context work as expected

Signed-off-by: Corbin Phelps <[email protected]>

* Cleaned up flusher doc

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed up some comments and readme verbage

Signed-off-by: Corbin Phelps <[email protected]>

* Grammer PR feedback

Signed-off-by: Corbin Phelps <[email protected]>

* Disk buffer rewrite (#539)

* Ran go mod tidy

Signed-off-by: Corbin Phelps <[email protected]>

* Disk buffer rewrite

* cleanup some code; bump up test coverage a bit.

* Factor ErrEntryTooLarge into its own exported error

* fix mutex copy in tests

* use require.ErrorIs when asserting error type

* tweak doc

* Rewrite to use a circular buffer (ring buffer) -- in-progress

* add old benchmarks in

* Try using previous greedy strategy

The old disk buffer uses an "unfair" strategy, where
one reader will get all entries up to max chunk size before it times out.

* Use 1 mebibyte for disk buffer benchmark

* some performance changes

* fix broken circular file

* cleanup some todos and commented code

* multierr in disk_metadata constructor

* update path description

* don't export things other than the buffer

* rb -> cf, unexport some methods on circularFile struct

* unexport another method on circularFile

* Comment circular_file liberally

* remove multierr, minor comments

* unexport some more methods/structs

* remove redundant seekedRead sets in discard

* update docs; change marshalEntry to not take in a byte slice

* remove ability to partial write

* Capitalize struct methods used in other files

* Make Start, End etc in circular file unexported

* put cirularFile reads/writes into a for loop

* refactor some conditionals with small helper functions

Co-authored-by: Corbin Phelps <[email protected]>

* Forward buffer (#549)

* push up forward output

* Refactored flush buffer

* Updated buffer close test for forward output

* Added closing of test server in forward tests

Signed-off-by: Corbin Phelps <[email protected]>

Co-authored-by: jmwilliams89 <[email protected]>
Co-authored-by: Corbin Phelps <[email protected]>

* Elastic buffer (#552)

* Changed the buffer interface and updated affected operators

Moved current buffers to .old files and created stubs of new ones that satisfy the interface

Signed-off-by: Corbin Phelps <[email protected]>

* Refactored buffer interface to remove drain in favor of a close that returns entries (#498)

Signed-off-by: Corbin Phelps <[email protected]>

* Memory buffer rework (#497)

* Implemented reworked memory buffer and started tests

Signed-off-by: Corbin Phelps <[email protected]>

* Working on memory buffer tests

Signed-off-by: Corbin Phelps <[email protected]>

* Fully tested memory buffer

Signed-off-by: Corbin Phelps <[email protected]>

* Removed memory_buffer*.old files

Signed-off-by: Corbin Phelps <[email protected]>

* Removed intentional race condition from memory buffer test so race flag wouldn't tirgger

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed comment in memorybuffer build

Signed-off-by: Corbin Phelps <[email protected]>

* Renamed buffer closed error

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed output operators. Most would fail on error equality to a wrapped error

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed comment for memorybuffer

Signed-off-by: Corbin Phelps <[email protected]>

* Removed operatorID from buffer builder interface (#499)

Signed-off-by: Corbin Phelps <[email protected]>

* Corrected documentation of memory buffer (#502)

* Corrected documentation of memory buffer

Signed-off-by: Corbin Phelps <[email protected]>

* Implemented PR feedback

Signed-off-by: Corbin Phelps <[email protected]>

* Implemented some wording changes

Signed-off-by: Corbin Phelps <[email protected]>

* Refactored flusher logic (#501)

* Refactored flusher to be a bit more readable and to have the context work as expected

Signed-off-by: Corbin Phelps <[email protected]>

* Cleaned up flusher doc

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed up some comments and readme verbage

Signed-off-by: Corbin Phelps <[email protected]>

* Grammer PR feedback

Signed-off-by: Corbin Phelps <[email protected]>

* Disk buffer rewrite (#539)

* Ran go mod tidy

Signed-off-by: Corbin Phelps <[email protected]>

* Disk buffer rewrite

* cleanup some code; bump up test coverage a bit.

* Factor ErrEntryTooLarge into its own exported error

* fix mutex copy in tests

* use require.ErrorIs when asserting error type

* tweak doc

* Rewrite to use a circular buffer (ring buffer) -- in-progress

* add old benchmarks in

* Try using previous greedy strategy

The old disk buffer uses an "unfair" strategy, where
one reader will get all entries up to max chunk size before it times out.

* Use 1 mebibyte for disk buffer benchmark

* some performance changes

* fix broken circular file

* cleanup some todos and commented code

* multierr in disk_metadata constructor

* update path description

* don't export things other than the buffer

* rb -> cf, unexport some methods on circularFile struct

* unexport another method on circularFile

* Comment circular_file liberally

* remove multierr, minor comments

* unexport some more methods/structs

* remove redundant seekedRead sets in discard

* update docs; change marshalEntry to not take in a byte slice

* remove ability to partial write

* Capitalize struct methods used in other files

* Make Start, End etc in circular file unexported

* put cirularFile reads/writes into a for loop

* refactor some conditionals with small helper functions

Co-authored-by: Corbin Phelps <[email protected]>

* push up forward output

* Refactored flush buffer

* Updated buffer close test for forward output

* push up forward output

* Refactored flush buffer

* Updated buffer close test for forward output

* updated elastic output

* Changed the buffer interface and updated affected operators

Moved current buffers to .old files and created stubs of new ones that satisfy the interface

Signed-off-by: Corbin Phelps <[email protected]>

* Memory buffer rework (#497)

* Implemented reworked memory buffer and started tests

Signed-off-by: Corbin Phelps <[email protected]>

* Working on memory buffer tests

Signed-off-by: Corbin Phelps <[email protected]>

* Fully tested memory buffer

Signed-off-by: Corbin Phelps <[email protected]>

* Removed memory_buffer*.old files

Signed-off-by: Corbin Phelps <[email protected]>

* Removed intentional race condition from memory buffer test so race flag wouldn't tirgger

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed comment in memorybuffer build

Signed-off-by: Corbin Phelps <[email protected]>

* Renamed buffer closed error

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed output operators. Most would fail on error equality to a wrapped error

Signed-off-by: Corbin Phelps <[email protected]>

* Fixed comment for memorybuffer

Signed-off-by: Corbin Phelps <[email protected]>

* Removed operatorID from buffer builder interface (#499)

Signed-off-by: Corbin Phelps <[email protected]>

* Disk buffer rewrite (#539)

* Ran go mod tidy

Signed-off-by: Corbin Phelps <[email protected]>

* Disk buffer rewrite

* cleanup some code; bump up test coverage a bit.

* Factor ErrEntryTooLarge into its own exported error

* fix mutex copy in tests

* use require.ErrorIs when asserting error type

* tweak doc

* Rewrite to use a circular buffer (ring buffer) -- in-progress

* add old benchmarks in

* Try using previous greedy strategy

The old disk buffer uses an "unfair" strategy, where
one reader will get all entries up to max chunk size before it times out.

* Use 1 mebibyte for disk buffer benchmark

* some performance changes

* fix broken circular file

* cleanup some todos and commented code

* multierr in disk_metadata constructor

* update path description

* don't export things other than the buffer

* rb -> cf, unexport some methods on circularFile struct

* unexport another method on circularFile

* Comment circular_file liberally

* remove multierr, minor comments

* unexport some more methods/structs

* remove redundant seekedRead sets in discard

* update docs; change marshalEntry to not take in a byte slice

* remove ability to partial write

* Capitalize struct methods used in other files

* Make Start, End etc in circular file unexported

* put cirularFile reads/writes into a for loop

* refactor some conditionals with small helper functions

Co-authored-by: Corbin Phelps <[email protected]>

* got rid of errorf in stop()

Co-authored-by: Corbin Phelps <[email protected]>
Co-authored-by: Corbin Phelps <[email protected]>
Co-authored-by: Brandon Johnson <[email protected]>
Co-authored-by: jmwilliams89 <[email protected]>

* Google buffer (#563)

* wip

* wip

* flushes buffer after Stop()

* updated google-output tests

* made recommended changes from brandon

* Linter fixes (#566)

Signed-off-by: Corbin Phelps <[email protected]>

* added newrelic close buffer (#577)

* added newrelic close buffer

* made necessary fixes

* made necessary fixes

* unexport client from client.go

* Fixed reverted timeout in disk test

Signed-off-by: Corbin Phelps <[email protected]>

* added check for no entries upon stop

Co-authored-by: Brandon Johnson <[email protected]>
Co-authored-by: Mitchell Armstrong <[email protected]>
Co-authored-by: jmwilliams89 <[email protected]>
Co-authored-by: armstrmi <[email protected]>
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