From e23abc710aa2882be9d350b97d2290b8e163691c Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Fri, 16 Dec 2022 15:13:32 -0800 Subject: [PATCH] Web console: default max workers to cluster capacity and simplify live reports (#13577) * step * better capacity * start with capacity * more compressed stats display * better rule editor * fix SQL data loader also * update snapshots * new line * better formatting --- .../components/braced-text/braced-text.tsx | 6 +- .../__snapshots__/header-bar.spec.tsx.snap | 1 + .../components/header-bar/header-bar.spec.tsx | 2 +- .../src/components/header-bar/header-bar.tsx | 2 +- .../__snapshots__/rule-editor.spec.tsx.snap | 192 ++++++++++++++++-- .../rule-editor/rule-editor.spec.tsx | 10 +- .../components/rule-editor/rule-editor.tsx | 2 +- .../segment-timeline.spec.tsx | 2 +- .../segment-timeline/segment-timeline.tsx | 2 +- web-console/src/console-application.tsx | 25 ++- .../retention-dialog.spec.tsx.snap | 6 +- .../src/druid-models/execution/execution.ts | 4 +- .../query-context/query-context.tsx | 5 +- .../workbench-query/workbench-query.ts | 7 + .../src/{utils => helpers}/capabilities.ts | 48 +++-- web-console/src/helpers/capacity.ts | 6 +- web-console/src/helpers/index.ts | 1 + web-console/src/hooks/index.ts | 1 + web-console/src/hooks/use-clock.ts | 41 ++++ web-console/src/utils/index.tsx | 1 - web-console/src/utils/load-rule.ts | 32 ++- .../datasources-view.spec.tsx | 2 +- .../datasources-view/datasources-view.tsx | 55 ++--- .../__snapshots__/home-view.spec.tsx.snap | 12 ++ .../datasources-card.spec.tsx | 2 +- .../datasources-card/datasources-card.tsx | 5 +- .../home-view-card/home-view-card.scss | 2 +- .../src/views/home-view/home-view.spec.tsx | 2 +- web-console/src/views/home-view/home-view.tsx | 2 +- .../lookups-card/lookups-card.spec.tsx | 2 +- .../home-view/lookups-card/lookups-card.tsx | 3 +- .../segments-card/segments-card.spec.tsx | 2 +- .../home-view/segments-card/segments-card.tsx | 3 +- .../services-card/services-card.spec.tsx | 2 +- .../home-view/services-card/services-card.tsx | 3 +- .../supervisors-card.spec.tsx | 2 +- .../supervisors-card/supervisors-card.tsx | 3 +- .../home-view/tasks-card/tasks-card.spec.tsx | 2 +- .../views/home-view/tasks-card/tasks-card.tsx | 112 +++++----- .../ingestion-view/ingestion-view.spec.tsx | 2 +- .../views/ingestion-view/ingestion-view.tsx | 2 +- .../__snapshots__/segments-view.spec.tsx.snap | 28 ++- .../segments-view/segments-view.spec.tsx | 2 +- .../src/views/segments-view/segments-view.tsx | 49 +++-- .../services-view/services-view.spec.tsx | 3 +- .../src/views/services-view/services-view.tsx | 3 +- .../ingestion-progress-dialog.tsx | 25 ++- .../sql-data-loader-view.tsx | 73 +++++-- .../capacity-alert/capacity-alert.tsx | 6 +- .../execution-stages-pane.spec.tsx.snap | 16 +- .../execution-stages-pane.scss | 5 - .../execution-stages-pane.tsx | 160 +++++++-------- .../helper-query/helper-query.tsx | 12 +- .../max-tasks-button.spec.tsx.snap | 87 ++------ .../max-tasks-button.spec.tsx | 4 +- .../max-tasks-button/max-tasks-button.tsx | 38 +++- .../workbench-view/query-tab/query-tab.tsx | 13 +- .../recent-query-task-panel.tsx | 11 +- .../workbench-view/run-panel/run-panel.tsx | 10 +- .../views/workbench-view/workbench-view.tsx | 12 +- 60 files changed, 760 insertions(+), 413 deletions(-) rename web-console/src/{utils => helpers}/capabilities.ts (86%) create mode 100644 web-console/src/hooks/use-clock.ts diff --git a/web-console/src/components/braced-text/braced-text.tsx b/web-console/src/components/braced-text/braced-text.tsx index 7416653d983..59840215ce3 100644 --- a/web-console/src/components/braced-text/braced-text.tsx +++ b/web-console/src/components/braced-text/braced-text.tsx @@ -30,6 +30,7 @@ export interface BracedTextProps { braces: string[]; padFractionalPart?: boolean; unselectableThousandsSeparator?: boolean; + title?: string; } export function findMostNumbers(strings: string[]): string { @@ -82,7 +83,8 @@ function hideThousandsSeparator(text: string) { } export const BracedText = React.memo(function BracedText(props: BracedTextProps) { - const { className, text, braces, padFractionalPart, unselectableThousandsSeparator } = props; + const { className, text, braces, padFractionalPart, unselectableThousandsSeparator, title } = + props; let effectiveBraces = braces.concat(text); @@ -112,7 +114,7 @@ export const BracedText = React.memo(function BracedText(props: BracedTextProps) } return ( - + {findMostNumbers(effectiveBraces)} {unselectableThousandsSeparator ? hideThousandsSeparator(text) : text} diff --git a/web-console/src/components/header-bar/__snapshots__/header-bar.spec.tsx.snap b/web-console/src/components/header-bar/__snapshots__/header-bar.spec.tsx.snap index 92ea6c77b87..43415e5a304 100644 --- a/web-console/src/components/header-bar/__snapshots__/header-bar.spec.tsx.snap +++ b/web-console/src/components/header-bar/__snapshots__/header-bar.spec.tsx.snap @@ -181,6 +181,7 @@ exports[`HeaderBar matches snapshot 1`] = ` - loadForever + loadForever(1x)