ai: add ai-stream-status endpoint & client#198
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.
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.
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.
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.
Should we use snake_case like the other AI APIs?
| return m.rows, nil | ||
| } | ||
|
|
||
| func TestQueryAIStreamStatusEvents(t *testing.T) { |
No description provided.