-
Notifications
You must be signed in to change notification settings - Fork 5
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
ai: add ai-stream-status endpoint & client #198
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
===================================================
- Coverage 27.11864% 24.58194% -2.53670%
===================================================
Files 6 9 +3
Lines 413 598 +185
===================================================
+ Hits 112 147 +35
- Misses 286 435 +149
- Partials 15 16 +1
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
"stream_id", | ||
"avg(input_fps) as avg_input_fps", | ||
"avg(output_fps) as avg_output_fps", | ||
"countIf(last_error != '') as error_count", |
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 is not an entirely correct aggregation, the right way would be aggregating the error events. How hard would that be? I expected the data pipeline itself to be doing that kind of aggregation though, so we're not scanning the table at query time.
"avg(output_fps) as avg_output_fps", | ||
"countIf(last_error != '') as error_count", | ||
"arrayFilter(x -> x != '', groupUniqArray(last_error)) as errors", | ||
"sum(restart_count) as total_restarts", |
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 is also incorrect. restart_count
is already cumulative. This should be a max
on the simplest solution. Should work.
"countIf(last_error != '') as error_count", | ||
"arrayFilter(x -> x != '', groupUniqArray(last_error)) as errors", | ||
"sum(restart_count) as total_restarts", | ||
"arrayFilter(x -> x != '', groupUniqArray(last_restart_logs)) as restart_logs"). |
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.
Maybe only keep the last one as well? I think it would be confusing the merge+uniq these logs.
var ErrAssetNotFound = errors.New("asset not found") | ||
|
||
type StreamStatus struct { | ||
StreamID string `json:"streamId"` |
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 we use snake_case
like the other AI APIs?
return m.rows, nil | ||
} | ||
|
||
func TestQueryAIStreamStatusEvents(t *testing.T) { |
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.
Nice
No description provided.