-
Notifications
You must be signed in to change notification settings - Fork 3
chore: add event processor architectural diagrams #192
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8f8f400
chore: add event processor architectural diagram
cwaldren-ld cfed645
fix some event processor methods to match style guide
cwaldren-ld 4d5dfb4
formatting
cwaldren-ld 22d1a34
try to fix github's mermaid render
cwaldren-ld 834225d
maybe namespaces do not work?
cwaldren-ld bc1891d
swap IEventProcessor/Outbox association navigability directions
cwaldren-ld 514ea8f
make summary event creation clearer
cwaldren-ld d8a58e0
associate summarizer and featureEventParams
cwaldren-ld a03f944
add alias label to TrackEvent
cwaldren-ld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| # Analytic Event Processor | ||
|
|
||
| The Event Processor is responsible for consuming, batching, and delivering events generated | ||
| by the server and client-side LaunchDarkly SDKs. | ||
|
|
||
| ```mermaid | ||
| classDiagram | ||
| IEventProcessor <|-- NullEventProcessor | ||
| IEventProcessor <|-- AsioEventProcessor | ||
|
|
||
| AsioEventProcessor *-- LRUCache | ||
| AsioEventProcessor *-- Outbox | ||
| AsioEventProcessor *-- WorkerPool | ||
| AsioEventProcessor *-- Summarizer | ||
|
|
||
| RequestWorker *-- EventBatch | ||
| WorkerPool *-- "5" RequestWorker | ||
|
|
||
| TrackEvent -- TrackEventParams: (alias) | ||
| InputEvent *-- IdentifyEventParams | ||
| InputEvent *-- FeatureEventParams | ||
| InputEvent *-- TrackEventParams | ||
|
|
||
|
|
||
| OutputEvent *-- IndexEvent | ||
| OutputEvent *-- FeatureEvent | ||
| OutputEvent *-- DebugEvent | ||
| OutputEvent *-- IdentifyEvent | ||
| OutputEvent *-- TrackEvent | ||
|
|
||
| EventBatch --> Outbox: Pulls individual events from.. | ||
| EventBatch --> Summarizer: Pulls summary events from.. | ||
|
|
||
| IEventProcessor --> InputEvent | ||
| Outbox --> OutputEvent | ||
|
|
||
| Summarizer --> FeatureEventParams | ||
|
|
||
|
|
||
| class IEventProcessor { | ||
| <<interface>> | ||
| +SendAsync(InputEvent event) void | ||
| +FlushAsync() void | ||
| +ShutdownAsync() void | ||
| } | ||
|
|
||
| class NullEventProcessor { | ||
|
|
||
| } | ||
|
|
||
| class AsioEventProcessor { | ||
|
|
||
| } | ||
|
|
||
| class EventBatch { | ||
| +const Count() size_t | ||
| +const Request() network:: HttpRequest | ||
| +const Target() std:: string | ||
| } | ||
|
|
||
| class LRUCache { | ||
| +Notice(std:: string value) bool | ||
| +const Size() size_t | ||
| +Clear() void | ||
| } | ||
|
|
||
| class Outbox { | ||
| +PushDiscardingOverflow(std:: vector~OutputEvent~ events) bool | ||
| +Consume() std:: vector~OutputEvent~ | ||
| +const Empty() bool | ||
| } | ||
|
|
||
| class RequestWorker { | ||
| +const Available() bool | ||
| +AsyncDeliver(EventBatch, delivery_callback) | ||
| } | ||
|
|
||
| class WorkerPool { | ||
| +Get(worker_callback) void | ||
| } | ||
|
|
||
| class Summarizer { | ||
cwaldren-ld marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| +Update(FeatureEventParams) void | ||
| +Finish() | ||
| +const StartTime() Time | ||
| +const EndTime() Time | ||
| } | ||
|
|
||
| %% note: the 'namespace' feature isn't supported on Github yet | ||
| %% namespace events { | ||
| class InputEvent { | ||
| +std:: variant | ||
| } | ||
|
|
||
|
|
||
| class OutputEvent { | ||
| +std:: variant | ||
| } | ||
|
|
||
| class FeatureEventParams { | ||
|
|
||
| } | ||
|
|
||
| class IdentifyEventParams { | ||
|
|
||
| } | ||
|
|
||
| class TrackEventParams { | ||
|
|
||
| } | ||
|
|
||
| class FeatureEvent { | ||
|
|
||
| } | ||
|
|
||
| class DebugEvent { | ||
|
|
||
| } | ||
|
|
||
| class IdentifyEvent { | ||
|
|
||
| } | ||
|
|
||
| class IndexEvent { | ||
|
|
||
| } | ||
|
|
||
| class TrackEvent { | ||
|
|
||
| } | ||
|
|
||
| %% } | ||
| ``` | ||
|
|
||
| ### Notes | ||
|
|
||
| SDKs may be configured to disable events, so `NullEventProcessor` is made available. This component accepts | ||
| events generated | ||
| by the SDK and discards them. | ||
|
|
||
| If events are enabled, SDKs use the `AsioEventProcessor` implementation, which is an asynchronous processor | ||
| utilizing `boost::asio`. | ||
|
|
||
| Most event definitions are shared between the server and client-side SDKs. Unique to the server-side SDK | ||
| is `IndexEvent`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.