forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: link insights to fingerprint details
Now from the Insights page, clicking on the statement or fingerprint ids, it will bring you to their respective details page. This commit also filter out transaction insights that didn't have their value set yet (meaning they're still 0). Finally, this commit fixes the start/end values being passed to the combined statement endpoint, to the correct rounded values, aligning what we say on the UI. Fixes cockroachdb#87750 Release note (ui change): The fingerprint id values for statement and transactions on the insights pages are links that open the respective details page on the time period of the execution of that statement/transaction. Release note (bug fix): Sendind the proper start/end values to the endpoint used on SQL Activity page, now returning the full hour as described on the UI.
- Loading branch information
Showing
25 changed files
with
469 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...paces/cluster-ui/src/insights/workloadInsightDetails/statementInsightDetailsConnected.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
import { connect } from "react-redux"; | ||
import { Dispatch } from "redux"; | ||
import { RouteComponentProps, withRouter } from "react-router-dom"; | ||
import { | ||
StatementInsightDetails, | ||
StatementInsightDetailsDispatchProps, | ||
StatementInsightDetailsStateProps, | ||
} from "./statementInsightDetails"; | ||
import { AppState } from "src/store"; | ||
import { | ||
selectStatementInsightDetails, | ||
selectStatementInsightsError, | ||
} from "src/store/insights/statementInsights"; | ||
import { selectIsTenant } from "src/store/uiConfig"; | ||
import { TimeScale } from "../../timeScaleDropdown"; | ||
import { actions as sqlStatsActions } from "../../store/sqlStats"; | ||
|
||
const mapStateToProps = ( | ||
state: AppState, | ||
props: RouteComponentProps, | ||
): StatementInsightDetailsStateProps => { | ||
const insightStatements = selectStatementInsightDetails(state, props); | ||
const insightError = selectStatementInsightsError(state); | ||
return { | ||
insightEventDetails: insightStatements, | ||
insightError: insightError, | ||
isTenant: selectIsTenant(state), | ||
}; | ||
}; | ||
|
||
const mapDispatchToProps = ( | ||
dispatch: Dispatch, | ||
): StatementInsightDetailsDispatchProps => ({ | ||
setTimeScale: (ts: TimeScale) => { | ||
dispatch( | ||
sqlStatsActions.updateTimeScale({ | ||
ts: ts, | ||
}), | ||
); | ||
}, | ||
}); | ||
|
||
export const StatementInsightDetailsConnected = withRouter( | ||
connect< | ||
StatementInsightDetailsStateProps, | ||
StatementInsightDetailsDispatchProps, | ||
RouteComponentProps | ||
>( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(StatementInsightDetails), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ces/cluster-ui/src/insights/workloadInsightDetails/transactionInsightDetailsConnected.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright 2022 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
import { | ||
TransactionInsightDetails, | ||
TransactionInsightDetailsStateProps, | ||
TransactionInsightDetailsDispatchProps, | ||
} from "./transactionInsightDetails"; | ||
import { connect } from "react-redux"; | ||
import { RouteComponentProps, withRouter } from "react-router-dom"; | ||
import { AppState } from "src/store"; | ||
import { | ||
selectTransactionInsightDetails, | ||
selectTransactionInsightDetailsError, | ||
actions, | ||
} from "src/store/insightDetails/transactionInsightDetails"; | ||
import { TimeScale } from "../../timeScaleDropdown"; | ||
import { actions as sqlStatsActions } from "../../store/sqlStats"; | ||
import { Dispatch } from "redux"; | ||
|
||
const mapStateToProps = ( | ||
state: AppState, | ||
_props: RouteComponentProps, | ||
): TransactionInsightDetailsStateProps => { | ||
const insightDetails = selectTransactionInsightDetails(state); | ||
const insightError = selectTransactionInsightDetailsError(state); | ||
return { | ||
insightEventDetails: insightDetails, | ||
insightError: insightError, | ||
}; | ||
}; | ||
|
||
const mapDispatchToProps = ( | ||
dispatch: Dispatch, | ||
): TransactionInsightDetailsDispatchProps => ({ | ||
refreshTransactionInsightDetails: actions.refresh, | ||
setTimeScale: (ts: TimeScale) => { | ||
dispatch( | ||
sqlStatsActions.updateTimeScale({ | ||
ts: ts, | ||
}), | ||
); | ||
}, | ||
}); | ||
|
||
export const TransactionInsightDetailsConnected = withRouter( | ||
connect< | ||
TransactionInsightDetailsStateProps, | ||
TransactionInsightDetailsDispatchProps, | ||
RouteComponentProps | ||
>( | ||
mapStateToProps, | ||
mapDispatchToProps, | ||
)(TransactionInsightDetails), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.