-
Notifications
You must be signed in to change notification settings - Fork 54
[kernel-1116] browser events add s2 storage support #235
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
base: archand/kernel-1116/external-events
Are you sure you want to change the base?
Changes from all commits
9357d07
50602bb
31b2135
afbfa78
eae5f2a
d852919
17379dd
0e54ef4
a9495e0
83fa35e
c5443b5
dce67aa
944e0fa
df53c74
6998e1a
207b49a
4519dd4
ad61486
bf059ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ type ApiService struct { | |
|
|
||
| var _ oapi.StrictServerInterface = (*ApiService)(nil) | ||
|
|
||
| // New constructs an ApiService. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove |
||
| func New( | ||
| recordManager recorder.RecordManager, | ||
| factory recorder.FFmpegRecorderFactory, | ||
|
|
@@ -116,8 +117,8 @@ func New( | |
| ctx, cancel := context.WithCancel(context.Background()) | ||
|
|
||
| return &ApiService{ | ||
| recordManager: recordManager, | ||
| factory: factory, | ||
| recordManager: recordManager, | ||
| factory: factory, | ||
| defaultRecorderID: "default", | ||
| watches: make(map[string]*fsWatch), | ||
| procs: make(map[string]*processHandle), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,9 @@ func (s *ApiService) StopCaptureSession(_ context.Context, _ oapi.StopCaptureSes | |
| // tear down asynchronously, leaving IsRunning briefly true. | ||
| resp := s.buildSessionResponse() | ||
| resp.Status = oapi.CaptureSessionStatusStopped | ||
| // Session cleanup (Remove on the S2 producer) happens automatically in | ||
| // EventsStorageWriter.Run when it processes the SessionEnded event, ensuring | ||
| // all pending writes are flushed before the producer is torn down. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comment feels out of place. remove or move closer to the things it's talking about? |
||
| s.captureSession.Stop() | ||
|
|
||
| return oapi.StopCaptureSession200JSONResponse(resp), nil | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,8 +44,9 @@ func ValidCategory(c EventCategory) bool { | |
|
|
||
| // System event types emitted by the pipeline itself. | ||
| const ( | ||
| TypeSessionEnded = "session_ended" | ||
| TypeEventsDropped = "events_dropped" | ||
| SessionEnded = "session_ended" | ||
| EventsDropped = "events_dropped" | ||
| EventsStorageError = "storage_error" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i don't think we should publish this as an event--create's a feedback loop and exposes details that make more sense as logs |
||
| ) | ||
|
|
||
| type SourceKind string | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should there also be an s2 stream config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stream names are derived dynamically from the CaptureSessionID at runtime, so one S2 stream is created per capture session within the configured basin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will make it hard for, e.g. the API to know what stream to read when it wants to stream telemetry for a browser. It also is at odds with "one global event stream" that the cdp stuff publishes into. I would make this a constant that is injected on startup