ui/cluster-ui: create statements insights api#86596
ui/cluster-ui: create statements insights api#86596craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
maryliag
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @j82w and @xinhaoz)
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 249 at r1 (raw file):
session_id: string; txn_id: string; txn_fingerprint_id: string; // bytes
we are always using the ids as int64, so it's better to keep consistency, in case we want to use that value to link to the details page of that fingerprint id. To be able to do this there are 2 things you will need to change. I'll add a line on the 2 places
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 282 at r1 (raw file):
const end = moment.utc(row.end_time); return { transactionID: row.txn_id,
are you missing txn fingerprint ID? Looks like you can on the query, but don't use it
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 291 at r1 (raw file):
execType: InsightExecEnum.STATEMENT, statementID: row.stmt_id, statementFingerprintID: row.stmt_fingerprint_id,
use HexStringToInt64String(row.stmt_fingerprint_id)
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 314 at r1 (raw file):
session_id, txn_id, txn_fingerprint_id,
change to encode(txn_fingerprint_id, 'hex') AS txn_fingerprint_id,
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 316 at r1 (raw file):
txn_fingerprint_id, stmt_id, stmt_fingerprint_id,
change to encode(stmt_fingerprint_id, 'hex') AS stmt_fingerprint_id,
xinhaoz
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @j82w and @maryliag)
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 249 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
we are always using the ids as int64, so it's better to keep consistency, in case we want to use that value to link to the details page of that fingerprint id. To be able to do this there are 2 things you will need to change. I'll add a line on the 2 places
Done.
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 282 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
are you missing txn fingerprint ID? Looks like you can on the query, but don't use it
Done.
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 291 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
use
HexStringToInt64String(row.stmt_fingerprint_id)
Done.
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 314 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
change to
encode(txn_fingerprint_id, 'hex') AS txn_fingerprint_id,
Done.
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 316 at r1 (raw file):
Previously, maryliag (Marylia Gutierrez) wrote…
change to
encode(stmt_fingerprint_id, 'hex') AS stmt_fingerprint_id,
Done.
maryliag
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r2.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @j82w and @xinhaoz)
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 249 at r1 (raw file):
Previously, xinhaoz (Xin Hao Zhang) wrote…
Done.
don't forget to remove the bytes comment, since it's no longer bytes
fbf7be0 to
f7fb31a
Compare
maryliag
left a comment
There was a problem hiding this comment.
Reviewed 4 of 6 files at r1, 1 of 1 files at r3, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @j82w)
ericharmeling
left a comment
There was a problem hiding this comment.
Nice! LGTM
Reviewed all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @j82w)
j82w
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 308 at r4 (raw file):
} const statemenInsightsQuery: InsightQuery<
typo: statementInsightsQuery
j82w
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)
pkg/ui/workspaces/cluster-ui/src/api/insightsApi.ts line 290 at r4 (raw file):
endTime: end, databaseName: row.database_name, elapsedTimeMillis: start.diff(end, "milliseconds"),
This causes it to be negative. You need to reverse start and end.
j82w
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @maryliag)
|
TFTR! |
|
Build failed (retrying...): |
|
Build failed: |
|
bors r+ |
|
Build failed (retrying...): |
|
Build failed: |
|
bors r+ |
|
Build failed (retrying...): |
This commit adds a function to the `cluster-ui` pkg that queries `crdb_internal.cluster_execution_insights` to surface slow running queries. The information retrieved is intended to be used in the insights statement overview and details pages. A new field `statementInsights` is added to the `cachedData` object in the db-console redux store, and the corresponding function to issue the data fetch is also added in `apiReducers`. This commit does not add any reducers or sagas to CC to fetch and store this data. Release justification: non-production code change Release note: None
|
Canceled. |
|
bors r+ |
|
Build failed (retrying...): |
|
Build succeeded: |
This commit adds a function to the
cluster-uipkg that queriescrdb_internal.cluster_execution_insightsto surface slow runningqueries. The information retrieved is intended to be used in the
insights statement overview and details pages. A new field
statementInsightsis added to thecachedDataobject in thedb-console redux store, and the corresponding function to issue the
data fetch is also added in
apiReducers. This commit does not addany reducers or sagas to CC to fetch and store this data.
Release justification: non-production code change
Release note: None