vogievetsky commented on a change in pull request #7421: Add time taken by last
query in SQL view
URL: https://github.com/apache/incubator-druid/pull/7421#discussion_r273270784
##########
File path: web-console/src/views/sql-view.tsx
##########
@@ -62,25 +64,33 @@ export class SqlView extends React.Component<SqlViewProps,
SqlViewState> {
explainDialogOpen: false,
loadingExplain: false,
explainResult: null,
- explainError: null
+ explainError: null,
+ queryElapsed: 0
};
}
componentDidMount(): void {
this.sqlQueryManager = new QueryManager({
processQuery: async (query: string) => {
+ const startTime = new Date();
if (query.trim().startsWith('{')) {
// Secret way to issue a native JSON "rune" query
const runeQuery = Hjson.parse(query);
- return decodeRune(runeQuery, await queryDruidRune(runeQuery));
+ const result = await queryDruidRune(runeQuery);
+ this.setState({
Review comment:
do not call setState in `processQuery` you are making this function not
pure. pass it though to `onStateChange`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]