-
-
Notifications
You must be signed in to change notification settings - Fork 46
feat: colorize slow query #13
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ type Event struct { | |
| Error string | ||
| TxID string | ||
| NPlus1 bool | ||
| SlowQuery bool | ||
| NormalizedQuery string | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -200,15 +200,16 @@ function renderTable() { | |||||
| const fragment = document.createDocumentFragment(); | ||||||
| for (const {ev, idx} of filtered) { | ||||||
| const tr = document.createElement('tr'); | ||||||
| tr.className = 'row' + (idx === selectedIdx ? ' selected' : '') + (ev.error ? ' has-error' : '') + (ev.n_plus_1 ? ' n-plus-1' : ''); | ||||||
| tr.className = 'row' + (idx === selectedIdx ? ' selected' : '') + (ev.error ? ' has-error' : '') + (ev.n_plus_1 ? ' n-plus-1' : '') + (ev.slow_query ? ' slow-query' : ''); | ||||||
|
||||||
| tr.className = 'row' + (idx === selectedIdx ? ' selected' : '') + (ev.error ? ' has-error' : '') + (ev.n_plus_1 ? ' n-plus-1' : '') + (ev.slow_query ? ' slow-query' : ''); | |
| tr.className = 'row' + (idx === selectedIdx ? ' selected' : '') + (ev.error ? ' has-error' : ev.n_plus_1 ? ' n-plus-1' : ev.slow_query ? ' slow-query' : ''); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ type eventJSON struct { | |
| Error string `json:"error,omitempty"` | ||
| TxID string `json:"tx_id,omitempty"` | ||
| NPlus1 bool `json:"n_plus_1,omitempty"` | ||
| SlowQuery bool `json:"slow_query,omitempty"` | ||
| NormalizedQuery string `json:"normalized_query,omitempty"` | ||
| } | ||
|
|
||
|
|
@@ -96,6 +97,7 @@ func eventToJSON(ev proxy.Event) eventJSON { | |
| Error: ev.Error, | ||
| TxID: ev.TxID, | ||
| NPlus1: ev.NPlus1, | ||
| SlowQuery: ev.SlowQuery, | ||
|
||
| NormalizedQuery: ev.NormalizedQuery, | ||
| } | ||
| } | ||
|
|
||
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.
The SlowQuery field is added to the Event struct, but there are no tests verifying that this field is properly serialized in the gRPC Watch stream. Existing tests in server_test.go only verify basic fields like ID, Query, and Op. Consider adding a test case that publishes an Event with SlowQuery set to true and verifies it's correctly transmitted through the gRPC stream.