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

Simple PubSub Buffer #7

Merged
merged 5 commits into from
Sep 21, 2022
Merged

Simple PubSub Buffer #7

merged 5 commits into from
Sep 21, 2022

Conversation

bbengfort
Copy link
Contributor

@bbengfort bbengfort commented Sep 14, 2022

Scope of changes

Implements a simple channel based, in-memory pub/sub buffer. If there are no subscribers the events are dropped.

Fixes SC-9272

Type of change

  • new feature
  • bug fix
  • documentation
  • testing
  • technical debt
  • other (describe)

Acceptance criteria

To run the ensign server with monitoring:

$ ./containers/build.sh build 
$ ./containers/build.sh up

This will run ensign, prometheus, and grafana in docker compose

You can then run event generators as follows:

go run ./cmd/debug generate

You can run multiple of these in different terminals; the IDs should be monotonically increasing

To run consumers, use:

go run ./cmd/debug consume 

You can open up http://localhost:9080 to get to a Grafana dashboard (no login or dashboards have been setup yet).

Screen Shot 2022-09-21 at 12 05 52

Author checklist

  • I have manually tested the change and/or added automation in the form of unit tests or integration tests
  • I have updated the dependencies list
  • I have recompiled and included new protocol buffers to reflect changes I made
  • I have added new test fixtures as needed to support added tests
  • Check this box if a reviewer can merge this pull request after approval (leave it unchecked if you want to do it yourself)
  • I have moved the associated Shortcut story to "Ready for Review"

Reviewer(s) checklist

  • I've tried to generate events with several different processes
  • I've consumed events from one or more processes
  • I've observed the buffer limit putting backpressure on the publishers

@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #9272: Simple Pub/Sub Buffer.

@codecov
Copy link

codecov bot commented Sep 14, 2022

Codecov Report

Merging #7 (6e257b7) into main (5c867af) will decrease coverage by 7.20%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main       #7      +/-   ##
==========================================
- Coverage   67.58%   60.38%   -7.21%     
==========================================
  Files          13       14       +1     
  Lines         725      833     +108     
==========================================
+ Hits          490      503      +13     
- Misses        203      294      +91     
- Partials       32       36       +4     
Flag Coverage Δ
unittests 60.38% <ø> (-7.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ithub.com/rotationalio/ensign/pkg/ensign/server.go 41.02% <0.00%> (-3.27%) ⬇️
...ub.com/rotationalio/ensign/pkg/ensign/o11y/o11y.go 79.12% <0.00%> (-2.70%) ⬇️
...ithub.com/rotationalio/ensign/pkg/ensign/events.go 0.00% <0.00%> (ø)
...ithub.com/rotationalio/ensign/pkg/ensign/pubsub.go 31.57% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bbengfort bbengfort marked this pull request as ready for review September 21, 2022 17:04
@bbengfort bbengfort merged commit adfdbc7 into main Sep 21, 2022
@bbengfort bbengfort deleted the sc-9272/pubsub-buffer branch September 21, 2022 17:08
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.

None yet

1 participant